app.run(debug=True)
后来查了一下官网文档,原来Flask 1.0 版本不再支持之前的FLASK_ENV 环境变量了。
Prior to Flask 1.0 the FLASK_ENV environment variable was not supported and you needed to enable debug mode by exporting FLASK_DEBUG=1. This can still be used to control debug mode, but you should prefer setting the development environment as shown above.
http://flask.pocoo.org/docs/1.0/server/#server
必须要通过导入FLASK_DEBUG=1或者在Pycharm Run-> Edit Configurations里启用debug模式
所以用新版本之前,看看有哪些改动或者新功能,还是很有必要的。
原文:http://blog.51cto.com/jiaszwx/2315440