or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

cli.mdflask-integration.mdindex.md

index.mddocs/

0

# RQ Dashboard

1

2

A lightweight, general-purpose web interface to monitor Redis Queue (RQ) systems in realtime. RQ Dashboard provides comprehensive monitoring capabilities for RQ queues, jobs, and workers through an intuitive web interface that can be deployed as a standalone application or integrated into existing Flask applications.

3

4

## Package Information

5

6

- **Package Name**: rq-dashboard

7

- **Language**: Python

8

- **Installation**: `pip install rq-dashboard`

9

- **Dependencies**: rq>=1.0, Flask, redis, arrow, redis-sentinel-url

10

11

## Core Imports

12

13

```python

14

import rq_dashboard

15

```

16

17

For standalone CLI usage:

18

```python

19

from rq_dashboard.cli import main, make_flask_app

20

```

21

22

For Flask integration:

23

```python

24

from rq_dashboard import blueprint, default_settings

25

```

26

27

## Basic Usage

28

29

### Standalone CLI Application

30

31

```python

32

# Run as command-line application

33

from rq_dashboard.cli import main

34

35

if __name__ == "__main__":

36

main()

37

```

38

39

Command line usage:

40

```bash

41

# Basic usage with default settings

42

rq-dashboard

43

44

# With custom configuration

45

rq-dashboard --bind 0.0.0.0 --port 9181 --redis-url redis://localhost:6379

46

47

# With authentication

48

rq-dashboard --username admin --password secret

49

50

# Multiple Redis instances

51

rq-dashboard --redis-url redis://localhost:6379 --redis-url redis://localhost:6380

52

```

53

54

### Flask Application Integration

55

56

```python

57

from flask import Flask

58

from rq_dashboard import blueprint, default_settings

59

60

# Create Flask app

61

app = Flask(__name__)

62

63

# Configure with default settings

64

app.config.from_object(default_settings)

65

66

# Set Redis connection

67

app.config['RQ_DASHBOARD_REDIS_URL'] = 'redis://localhost:6379'

68

69

# Register the blueprint

70

app.register_blueprint(blueprint, url_prefix='/rq')

71

72

if __name__ == '__main__':

73

app.run()

74

```

75

76

## Architecture

77

78

RQ Dashboard follows a modular architecture:

79

80

- **CLI Module**: Standalone application with Click-based command-line interface

81

- **Web Module**: Flask blueprint providing web interface and REST API endpoints

82

- **Configuration**: Flexible configuration system supporting environment variables, config files, and programmatic setup

83

- **Multi-instance Support**: Ability to monitor multiple Redis instances simultaneously

84

- **Authentication**: Optional HTTP Basic Authentication for security

85

86

The dashboard provides both HTML views for human users and JSON API endpoints for programmatic access, making it suitable for both manual monitoring and integration with automated systems.

87

88

## Capabilities

89

90

### Command Line Interface

91

92

Complete standalone application with extensive configuration options for deployment flexibility. Supports authentication, multiple Redis instances, custom polling intervals, and various deployment scenarios including Docker and reverse proxy configurations.

93

94

```python { .api }

95

def main():

96

"""Entry point for rq-dashboard console script."""

97

98

def run(bind, port, url_prefix, username, password, config, redis_url, poll_interval, debug, verbose, **kwargs):

99

"""

100

Run the RQ Dashboard Flask server with configuration options.

101

"""

102

103

def make_flask_app(config, username, password, url_prefix, compatibility_mode=True):

104

"""

105

Return Flask app with default configuration and registered blueprint.

106

107

Args:

108

config: Python module name for configuration

109

username: HTTP Basic Auth username

110

password: HTTP Basic Auth password

111

url_prefix: URL prefix for blueprint registration

112

compatibility_mode: Enable legacy configuration support

113

114

Returns:

115

Flask: Configured Flask application with RQ Dashboard

116

"""

117

```

118

119

[Command Line Interface](./cli.md)

120

121

### Flask Integration

122

123

Flask blueprint for embedding RQ Dashboard into existing Flask applications. Provides complete web interface with HTML views and JSON API endpoints for monitoring queues, jobs, and workers.

124

125

```python { .api }

126

blueprint: Blueprint

127

"""Main Flask blueprint for RQ Dashboard web interface."""

128

129

def setup_rq_connection(current_app):

130

"""

131

Set up Redis connection for RQ operations.

132

133

Args:

134

current_app: Flask application instance

135

"""

136

137

class Config:

138

"""Configuration container for RQ Dashboard settings."""

139

serializer: Any

140

```

141

142

[Flask Integration](./flask-integration.md)

143

144

## Configuration Options

145

146

### Environment Variables

147

148

All CLI options can be configured via environment variables with `RQ_DASHBOARD_` prefix:

149

150

- `RQ_DASHBOARD_REDIS_URL`: Redis connection URL(s)

151

- `RQ_DASHBOARD_POLL_INTERVAL`: Web interface refresh interval in milliseconds

152

- `RQ_DASHBOARD_DISABLE_DELETE`: Disable job deletion capabilities

153

- `RQ_DASHBOARD_SETTINGS`: Path to configuration file

154

155

### Flask Configuration Keys

156

157

- `RQ_DASHBOARD_REDIS_URL`: Redis URL (string or list for multiple instances)

158

- `RQ_DASHBOARD_POLL_INTERVAL`: Polling interval in milliseconds (default: 2500)

159

- `RQ_DASHBOARD_DISABLE_DELETE`: Disable delete operations (boolean)

160

161

## Types

162

163

```python { .api }

164

from typing import Optional, Union, List, Dict, Any

165

from flask import Blueprint, Flask

166

from redis import Redis

167

168

RedisUrl = Union[str, List[str]]

169

ConfigModule = Optional[str]

170

AuthCredentials = Optional[str]

171

```