Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in docs: CELERY_ROUTES -> CELERY_TASK_ROUTES #5026

Closed
maxim25 opened this issue Sep 3, 2018 · 3 comments
Closed

Error in docs: CELERY_ROUTES -> CELERY_TASK_ROUTES #5026

maxim25 opened this issue Sep 3, 2018 · 3 comments

Comments

@maxim25
Copy link

maxim25 commented Sep 3, 2018

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

@auvipy
Copy link
Member

auvipy commented Sep 8, 2018

could you send pr with suggested edits?

@JamesMura
Copy link

this is related to #4510

@auvipy auvipy closed this as completed Nov 21, 2018
@sparrowt
Copy link

sparrowt commented Jan 3, 2019

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 name
  • CELERY_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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants