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

后端 未结 6 1351
南旧
南旧 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:02

    Celery uses celery file for storing configuration of your app, you can't just give a python file with tasks and start celery. You should define celery file ( for Celery>3.0; previously it was celeryconfig.py)..

    celeryd --app app.celery -l info

    This example how to start celery with config file at app/celery.py

    Here is example of celery file: https://github.com/Kami/libcloud-sandbox/blob/master/celeryconfig.py

提交回复
热议问题