pycharm+Flask读取配置⽂件⽆法使⽤debug模式⽬录
⼀、配置⽂件
settings.py
# 开发模式配置⽂件
ENV = 'development'
DEBUG = True
⼆、应⽤
app.py
from flask import Flask
武汉科技大学怎么样import settings
app = Flask(__name__)
@ute('/')
def hello_world():
小吃鸡IDreturn 'Hello World!'
if __name__ == '__main__':
app.run()
三、启动服务
下⽅提⽰还是0,未开启debug模式
有什么好听的钢琴曲FLASK_APP = app.py
FLASK_ENV = development
FLASK_DEBUG = 0
In folder C:/Users/cheng/PycharmProjects/FlaskStudy
C:\Users\cheng\PycharmProjects\FlaskStudy\venv\ -m flask run
* Serving Flask app 'app.py' (lazy loading)
* Environment: development
* Debug mode: off
限电限产* Running on 127.0.0.1:5000/ (Press CTRL+C to quit)
著名钢琴曲四、解决⽅案
勾上
效果
FLASK_APP = app.py
FLASK_ENV = development
FLASK_DEBUG = 1
In folder C:/Users/cheng/PycharmProjects/FlaskStudy
营养师怎么报考C:\Users\cheng\PycharmProjects\FlaskStudy\venv\ -m flask run * Serving Flask app 'app.py' (lazy loading)
* Environment: development
* Debug mode: on
* Restarting with stat
* Debugger is active!
* Debugger PIN: 854-951-047
* Running on 127.0.0.1:5000/ (Press CTRL+C to quit)
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论