[Django]-Celery+Django — KeyError Unregistered task

5👍

In you question you show starting your worker with:

celery -A myproj worker --app=taskman.celery --loglevel=DEBUG

Now, the problem is that -A and --app mean the same thing. So this suggests to me that you’ve been waffling between using myproj or taskman.celery as the holder of your Celery app. Your worker uses taskman.celery, because from testing I’ve found that if any combination of -A or --app are given to a single worker invocation only the last one is used.

This being said, there is one way I can imagine your problem happening. If your myapp/tasks.py file gets the task decorator from myproj.celery.app rather than taskman.celery.app, you’d be registering your tasks with the wrong app.

👤Louis

Leave a comment