Starting Celery: AttributeError: 'module' object has no attribute 'celery'

后端 未结 6 1356
南旧
南旧 2021-02-04 02:33

I try to start a Celery worker server from a command line:

celery -A tasks worker --loglevel=info

The code in tasks.py:

import          


        
6条回答
  •  南方客
    南方客 (楼主)
    2021-02-04 03:12

    When you run celery -A tasks worker --loglevel=info, your celery app should be exposed in the module tasks. It shouldn't be wrapped in a function or an if statements that.

    If you make_celery in another file, you should import the celery app in to your the file you are passing to celery.

提交回复
热议问题