CELERY_ROUTES should be CELERY_TASK_ROUTES
http://docs.celeryproject.org/en/latest/userguide/configuration.html
spent a few hours before figuring that out :(
I imagine the same applied to CELERY_QUEUES
could you send pr with suggested edits?
this is related to https://github.com/celery/celery/pull/4510
The docs are actually correct, but it took me a while to figure out why - I'll explain in case it helps others.
CELERY_ROUTES
is the old celery setting name which has now been replaced by task_routes
. However if you want to specify Celery settings in a _Django_ settings file, they must be upper-case as required by Django docs. This would mean adding TASK_ROUTES
to your Django settings file, but to avoid conflict with other django settings it's recommended to prefix celery settings with CELERY_
, which would result in you adding for example CELERY_TASK_ROUTES
to your Django settings file. Your code would then load this into the celery app by doing something like this:
app.config_from_object('django.conf:settings', namespace='CELERY')
This would result in Celery taking CELERY_TASK_ROUTES
, stripping the namespace prefix to get TASK_ROUTES
, and lower-casing it to get task_routes
. The result being that it will set the celery config via the new name.
In summary:
CELERY_ROUTES
is the old celery setting nameCELERY_TASK_ROUTES
is an upper-cased, prefixed alteration of the new setting name, commonly used to set the new setting name from a Django settings file.Hope that helps.
(Based on my shorter comment on this stack overflow answer)
Most helpful comment
The docs are actually correct, but it took me a while to figure out why - I'll explain in case it helps others.
CELERY_ROUTES
is the old celery setting name which has now been replaced bytask_routes
. However if you want to specify Celery settings in a _Django_ settings file, they must be upper-case as required by Django docs. This would mean addingTASK_ROUTES
to your Django settings file, but to avoid conflict with other django settings it's recommended to prefix celery settings withCELERY_
, which would result in you adding for exampleCELERY_TASK_ROUTES
to your Django settings file. Your code would then load this into the celery app by doing something like this:This would result in Celery taking
CELERY_TASK_ROUTES
, stripping the namespace prefix to getTASK_ROUTES
, and lower-casing it to gettask_routes
. The result being that it will set the celery config via the new name.In summary:
CELERY_ROUTES
is the old celery setting nameCELERY_TASK_ROUTES
is an upper-cased, prefixed alteration of the new setting name, commonly used to set the new setting name from a Django settings file.Hope that helps.
(Based on my shorter comment on this stack overflow answer)