AttributeError: 'Flask' object has no attribute 'user_options'

后端 未结 4 596
醉梦人生
醉梦人生 2020-12-23 11:14

I am trying to setup this basic example from the following doc:

http://flask.pocoo.org/docs/patterns/celery/

But so far I keep g

相关标签:
4条回答
  • 2020-12-23 11:53

    like this:

    celery -A your_application worker
    

    where your_application stands:

    your_application = Flask(\__name\__)
    

    the python file name: your_application.py, it will work

    By the way, celery v4 is unsupported in Windows

    0 讨论(0)
  • 2020-12-23 12:07

    The Flask Celery Based Background Tasks page (http://flask.pocoo.org/docs/patterns/celery/) suggests this to start celery:

    celery -A your_application worker

    The your_application string has to point to your application’s package or module that creates the celery object.

    Assuming the code resides in application.py, explicitly pointing to the celery object (not just the module name) avoided the error:

    celery -A application.celery worker

    0 讨论(0)
  • 2020-12-23 12:08

    This worked for me:

    celery -A my_app_module_name.celery worker
    
    0 讨论(0)
  • 2020-12-23 12:10

    rename app flask_app It will work

    0 讨论(0)
提交回复
热议问题