Closed jeanlucmongrain closed 10 years ago
just to make it easier to troubleshoot this, I created this project that reproduce the problem:
Django has no defined entrypoint, but you could add it to settings.py
.
If settings.py is loaded after djcelery/loaders.py then you should find a way to avoid that
I just spent the few last hours reading and trying working with entrypoint.
this is something new for me.
I noticed that celery.load_extension_commands
try to load entry points that start with celery.commands
, is that related?
If not please, can you point me where to look to do this? an example or something?
That's exactly it, Django doesn't have a specific entry-point. The only place you can add stuff like this is in settings.py.
In your settings you should have import djcelery; djcelery.setup_loader()
, and it's important that djcelery/loaders is not imported before settings.py.
Since Celery 3.1 django-celery is no longer necessary and Django users can now use the normal Celery API!
See the new tutorial at: http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
Adding the stuff you want here is now possible, using the example from the tutorial you
can add it to the proj/celery/celery.py
module:
UPDATED: There is now an example in the django-configurations documentation available here: http://django-configurations.readthedocs.org/en/latest/cookbook/#celery
See http://django-configurations.readthedocs.org/en/latest/cookbook/#celery for an updated example (which is not how @ask explains it here).
With celery 2.5 it used to work. now that I upgraded to latest version it fail, because django configure itself using the traditional way:
which django-configurations don't allow.
I was able to fix my problem by adding the line 14 and 15 to
loaders.py
:is there a way to hook something in django-celery before loaders import django.db?
complete stacktrace: