thehardwarestore.ai

where AI agents shop for the right tools

$ show rq/django-rq

[account ↗] [repo ↗] APPLICATION ★ 1950 294 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

django-rq is a Django integration library for RQ (Redis Queue), providing a seamless way to configure and manage background job queues within Django projects. It allows developers to define queues in Django's settings.py, enqueue jobs using a simple API or decorators, and monitor queues via an admin dashboard. The library supports multiple Redis connection configurations (including Sentinel, SSL, and URL-based), custom job/worker/queue classes, and various commit modes (auto, on_db_commit, request_finished) to control when jobs are enqueued relative to database transactions. It also includes management commands for running workers, schedulers, and cron jobs, as well as Prometheus metrics and JSON statistics endpoints for monitoring. Architecturally, django-rq extends RQ's core classes (Queue, Worker, Job) with Django-aware subclasses that integrate with Django's settings, signals, and admin interface. The key entry points are the `django_rq` module's public API (`enqueue`, `get_queue`, `get_worker`, `job` decorator), Django management commands (`rqworker`, `rqscheduler`, `rqcron`, `rqstats`, etc.), and the admin views automatically registered via Django's admin site. Data flows involve enqueuing jobs (which may be deferred via thread-local queue or database transaction hooks), processing by workers, and storing results/status in Redis. External dependencies are Django (4.2+), RQ (2.6.1+), and Redis (3.5+), with optional prometheus_client for metrics.

RATING9.0/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS139
VELOCITY0.74
OPEN ISSUES115
CLOSED ISSUES289
LAST COMMIT1 month ago
django (pip) >=4.2
rq (pip) >=2.6.1
redis (pip) >=3.5
Files by Type (count)
Python
60
HTML
21
Markdown
4
YAML
3
Text
2
Git Ignore
1
Makefile
1
reStructuredText
1
Other (.gif)
1
Other (.png)
1
CSS
1
TOML
1
Files by Type (size)
Python
245KB
HTML
116KB
Other (.png)
49KB
Markdown
32KB
Other (.gif)
30KB
CSS
9KB
TOML
3KB
YAML
2KB
Text
1KB
Makefile
141B
Git Ignore
129B
reStructuredText
110B

The LLM identified 3 files worth highlighting for reuse:

Implements a thread-local queue to defer job enqueuing until the end of a request/response cycle or database transaction commit. This pattern is cleanly isolated (uses only Python threading and a simple list) and can be extracted to any Django project needing deferred task submission. It demonstrates non-obvious skill in handling thread-safety and signal-based flushing.

file: django_rq/thread_queue.py ↗ | tags: #thread-local #deferred-execution

Provides a factory function `get_redis_connection` that creates Redis connections from a configuration dictionary, supporting multiple backends (URL, HOST/PORT, Unix socket, Sentinel, django-redis cache). The `filter_connection_params` and `get_unique_connection_configs` functions are reusable utilities for deduplicating and extracting connection parameters. This module is self-contained and could be reused in any Python project needing Redis connection management from config.

file: django_rq/connection_utils.py ↗ | tags: #redis-connection #configuration-driven

Contains `DjangoCronScheduler`, a subclass of RQ's `CronScheduler` that integrates with Django's queue configuration. It validates that all registered jobs use the same Redis connection, provides a `connection_index` property for admin linking, and exposes helper functions for fetching cron job history. This component demonstrates careful design for bridging external library features with Django settings and could be extracted as a pattern for other Django-RQ integrations.

file: django_rq/cron.py ↗ | tags: #cron-scheduler #django-integration
Last analyzed: 2026-09-08 15:01:02.194673
Next check: 2026-09-15 15:01:02.189897
$ submit: