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

对着背影说爱祢 提交于 2019-11-29 20:37:36
TomL

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

This worked for me:

celery -A my_app_module_name.celery worker

rename app flask_app It will work

user7374381

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!