Celery: auto discovery does not find tasks module in app

前端 未结 7 2163
说谎
说谎 2021-02-19 19:50

I have the following setup with a fresh installed celery and django 1.4:

settings.py:

import djcelery
djcelery.setup_loader()

BROKER_HOST = \'localhost         


        
7条回答
  •  情书的邮戳
    2021-02-19 20:04

    Adding on to Umair A.'s answer, there was an ImportError exception in my tasks.py file that was causing Celery to not register the tasks in the module. All other module tasks were registered correctly.

    This error wasn't evident until I tried importing the Celery task within a Python Shell. I fixed the bad import statement and then the tasks were successfully registered.

提交回复
热议问题