我用PyCharm创建了一个falsk项目,一直打不开debug模式。
用的是创建项目自带的代码,在编辑里面把debug打勾了再运行
结果:FLASK_APP = app.py
FLASK_ENV = development
FLASK_DEBUG = 1
In folder E:/Pycharm_projects/flaskProject
E:\Pycharm_projects\Scripts\python.exe -m flask run
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
请问是什么原因,怎样打开debug模式?
你设置断点了嘛?
如果你是 flask 模块启动,试一试把 flask run
换成 flask --debug run
如果你是直接运行程序,把 app.py 中的 app.run()
改为 app.run(debug=True)
在代码中添加app.debug = True ,或者把app.run() 改作 app.run(debug =True)
在flask里面的调试模式应该是指更改源文件的时候不用重启代码吧,
一般flask也比较少用代码调试的debug