英文:
Flask "no such option --debug"
问题
这是在尝试运行Flask应用时发生的情况:
flask run --debug
尝试过:
flask run --debug
期望输出:
* 调试模式:开启
警告:这是一个开发服务器,请勿在生产环境中使用。请使用生产WSGI服务器。
* 运行在 http://127.0.0.1:5000
按CTRL+C退出
* 使用stat重新启动
* 调试器已激活!
* 调试器PIN码:272-345-882
英文:
This happens when you try to run flask app using
flask run --debug
Tried:
flask run --debug
Expecting:
* Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on http://127.0.0.1:5000
Press CTRL+C to quit
* Restarting with stat
* Debugger is active!
* Debugger PIN: 272-345-882
答案1
得分: 3
更改顺序的简单解决方案是:
flask --debug run
如果您想添加其他标志,可以这样做:
flask --debug run --host=0.0.0.0 --port=8000
英文:
The simple solution to this is to change the order:
flask --debug run
and if you want to add other flags, you can!
flask --debug run --host=0.0.0.0 --port=8000
答案2
得分: 2
I was following the Quickstart guide of flask documentation and faced this error "No such option: --debug"
This solution worked for me.
flask --debug run
Putting --debug before run.
英文:
I was following the Quickstart guide of flask documentation and faced this error "No such option: --debug"
This solution worked for me.
flask --debug run
Putting --debug before run.
答案3
得分: 1
问题是Flask的旧版本。运行pip install --upgrade flask
来解决它。
英文:
For me, the issue was an old version of Flask. Running pip install --upgrade flask
fixed it.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论