Celery: auto discovery does not find tasks module in app

前端 未结 7 2207
说谎
说谎 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:20

    Add CELERY_IMPORTS to your settings.py:

    CELERY_IMPORTS = ('testapp.tasks',)
    

    Import all the tasks in testapp.tasks.__init__ file

    Then Celery will import all tasks from testapp.tasks folder and name them as they are

提交回复
热议问题