A lightweight web interface to monitor RQ queues, jobs, and workers in realtime
—
Complete standalone RQ Dashboard application with extensive configuration options. The CLI provides a full-featured web server for monitoring RQ systems with support for authentication, multiple Redis instances, and flexible deployment scenarios.
Primary entry point for the rq-dashboard console command, with automatic environment variable configuration.
def main():
"""
Entry point for rq-dashboard console script.
Automatically configures from environment variables with RQ_DASHBOARD_ prefix.
All CLI options can be set via environment variables.
"""Usage:
from rq_dashboard.cli import main
if __name__ == "__main__":
main()Core server function with comprehensive configuration options for all deployment scenarios.
def run(
bind="0.0.0.0",
port=9181,
url_prefix="",
username=None,
password=None,
config=None,
redis_url=[],
poll_interval=None,
extra_path=["."],
disable_delete=False,
debug=False,
verbose=False,
json=False,
**deprecated_kwargs
):
"""
Run the RQ Dashboard Flask server.
All configuration can be set on the command line or through environment
variables of the form RQ_DASHBOARD_*. For example RQ_DASHBOARD_USERNAME.
Args:
bind: IP or hostname to bind HTTP server (default: "0.0.0.0")
port: Port to bind HTTP server (default: 9181)
url_prefix: URL prefix for reverse proxy usage (default: "")
username: HTTP Basic Auth username (optional)
password: HTTP Basic Auth password (optional)
config: Configuration file (Python module on search path)
redis_url: Redis URL(s), can specify multiple (default: ["redis://127.0.0.1:6379"])
poll_interval: Refresh interval in milliseconds (optional)
extra_path: Directories to append to sys.path (default: ["."])
disable_delete: Disable delete jobs and cleanup registries (default: False)
debug: Enable Flask debug mode (default: False)
verbose: Enable verbose logging (default: False)
json: Enable JSONSerializer for RQ operations (default: False)
"""Creates a configured Flask application with RQ Dashboard blueprint.
def make_flask_app(config, username, password, url_prefix, compatibility_mode=True):
"""
Return Flask app with default configuration and registered blueprint.
Args:
config: Python module name for configuration (optional)
username: HTTP Basic Auth username (optional)
password: HTTP Basic Auth password (optional)
url_prefix: URL prefix for blueprint registration (default: "")
compatibility_mode: Enable legacy configuration support (default: True)
Returns:
Flask: Configured Flask application with RQ Dashboard blueprint registered
"""Usage example:
from rq_dashboard.cli import make_flask_app
# Create app with basic auth
app = make_flask_app(
config="myapp.rq_config",
username="admin",
password="secret",
url_prefix="/rq"
)
# Run with custom configuration
app.run(host="0.0.0.0", port=8080, debug=True)Adds HTTP Basic Authentication to Flask blueprints.
def add_basic_auth(blueprint, username, password, realm="RQ Dashboard"):
"""
Add HTTP Basic Auth to a blueprint.
Note: This is only for casual use! For production systems, use proper
authentication mechanisms provided by your Flask application framework.
Args:
blueprint: Flask Blueprint to protect
username: Required username for authentication
password: Required password for authentication
realm: Authentication realm name (default: "RQ Dashboard")
"""# Single Redis instance (default)
rq-dashboard --redis-url redis://localhost:6379
# Multiple Redis instances
rq-dashboard --redis-url redis://server1:6379 --redis-url redis://server2:6379
# Redis with authentication
rq-dashboard --redis-url redis://:password@localhost:6379
# Redis Sentinel
rq-dashboard --redis-url redis+sentinel://sentinel1:26379,sentinel2:26379/mymaster# Custom host and port
rq-dashboard --bind 0.0.0.0 --port 9181
# URL prefix for reverse proxy
rq-dashboard --url-prefix /monitoring/rq
# Debug mode
rq-dashboard --debug
# Enable verbose logging
rq-dashboard --verbose# HTTP Basic Auth
rq-dashboard --username admin --password secret
# Configuration file
rq-dashboard --config myapp.dashboard_config# Custom polling interval (milliseconds)
rq-dashboard --poll-interval 5000
# Disable delete operations
rq-dashboard --disable-delete
# Add paths to Python path
rq-dashboard --extra-path /path/to/modules --extra-path /another/path
# Use JSON serializer for RQ operations
rq-dashboard --jsonPython module configuration example:
# config.py
DEBUG = False
RQ_DASHBOARD_REDIS_URL = ['redis://localhost:6379', 'redis://localhost:6380']
RQ_DASHBOARD_POLL_INTERVAL = 5000
RQ_DASHBOARD_DISABLE_DELETE = TrueUsage:
rq-dashboard --config configAll options can be configured via environment variables:
export RQ_DASHBOARD_REDIS_URL="redis://localhost:6379"
export RQ_DASHBOARD_USERNAME="admin"
export RQ_DASHBOARD_PASSWORD="secret"
export RQ_DASHBOARD_POLL_INTERVAL="5000"
export RQ_DASHBOARD_DISABLE_DELETE="true"
rq-dashboardFROM python:3.9
RUN pip install rq-dashboard
EXPOSE 9181
CMD ["rq-dashboard", "--bind", "0.0.0.0"][Unit]
Description=RQ Dashboard
After=redis.service
[Service]
Type=simple
User=rq-dashboard
WorkingDirectory=/opt/rq-dashboard
Environment=RQ_DASHBOARD_REDIS_URL=redis://localhost:6379
ExecStart=/usr/local/bin/rq-dashboard --bind 127.0.0.1 --port 9181
Restart=always
[Install]
WantedBy=multi-user.targetNginx configuration for reverse proxy:
location /rq/ {
proxy_pass http://127.0.0.1:9181/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}Run with URL prefix:
rq-dashboard --url-prefix /rq --bind 127.0.0.1Install with Tessl CLI
npx tessl i tessl/pypi-rq-dashboard