Install and configure Django-RQ
masterTo use Django-RQ, install the package via pip and add django_rq to your INSTALLED_APPS. You must then define your queues in the RQ_QUEUES dictionary within your settings.py. Each queue configuration can specify connection details like HOST, PORT, DB, USERNAME, and PASSWORD, or use a URL string. You can also provide REDIS_CLIENT_KWARGS, CONNECTION_KWARGS, or SENTINEL_KWARGS for advanced Redis connection settings.
Requirements:
- Django (4.2+)
- RQ
pip install django-rqINSTALLED_APPS = (
# other apps
"django_rq",
)
RQ_QUEUES = {
'default': {
'HOST': 'localhost',
'PORT': 6379,
'DB': 0,
'USERNAME': 'some-user',
'PASSWORD': 'some-password',
'DEFAULT_TIMEOUT': 360,
'DEFAULT_RESULT_TTL': 800,
'REDIS_CLIENT_KWARGS': {
'ssl_cert_reqs': None,
},
},
'high': {
'URL': 'redis://localhost:6379/0',
'DEFAULT_TIMEOUT': 500,
},
}
RQ_EXCEPTION_HANDLERS = ['path.to.my.handler']