I just installed and configured Celery with RabbitMQ for a Django project and I was having an issue running tasks when I imported them like so:
from someapp.tasks import SomeTask
It worked when I added the project name:
from myproject.someapp.tasks import SomeTask
I tried adding this into the settings.py file but it doesn’t change anything:
CELERY_IMPORTS = ("myproject.someapp.tasks",)
I’m fine with leaving the project name on the import line since it works but I’d like to know if there’s a way around it or why it has to be that way.
It’s probably because you have
Instead you should add the directory containing the apps on the Python path (the project in
this case), and simply do
IMHO this makes more sense for an “app” anyway.