django-rq-cron
A Django app for running cron jobs with django-rq.
Installation
pip install django-rq-cron
Add to INSTALLED_APPS in your Django settings:
INSTALLED_APPS = [
# ...
'django_rq',
'django_rq_cron',
]
Configure RQ_QUEUES in your settings:
RQ_QUEUES = {
'default': {
'URL': 'redis://localhost:6379/0',
'DEFAULT_TIMEOUT': 360,
},
}
Run migrations:
python manage.py migrate
Usage
Create a cron job by defining a function with the @register_cron decorator:
from django_rq_cron.registry import register_cron
from django_rq_cron.models import CronJob
@register_cron(
description="My daily task",
cadence=CronJob.Cadence.DAILY,
queue="default" # Optional, defaults to "default"
)
def my_daily_task():
# Task implementation
pass
The package will automatically discover cron jobs in a 'crons' module in each installed app.
Bootstrap cron jobs with the management command:
python manage.py bootstrap_cron_jobs
Features
- Schedule jobs to run at different cadences (every minute, every 10 minutes, hourly, daily, weekly, monthly)
- Track job execution status in the database
- View job history and results in the Django admin
- Built-in jobs for cleanup and system health checks
License
MIT
Release files for django-rq-cron 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_rq_cron-0.1.1.tar.gz | 11.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_rq_cron-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.5 kB
Release files / django_rq_cron-0.1.1.tar.gz
| Download URL | django_rq_cron-0.1.1.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ec3844b5775e216d91909a0fc239923a6fce98795cc0cf074a21d6df3050663
|
|
BLAKE2b-256 checksum How to use checksums |
79ccdbb503025c896882a2e4bd5bf6d3500a1c8e4125bbeba6e625ce356349d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.6
|
Release files / django_rq_cron-0.1.1-py3-none-any.whl
| Download URL | django_rq_cron-0.1.1-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b8deb046ebc6d2cf204ef35ea03a541d34df87d7b6fb5509772e0ba549395a38
|
|
BLAKE2b-256 checksum How to use checksums |
f1365ce0cb35109f76acb04116b7148e8bc03d7d853391e36d3f9d54ff2782dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.6
|