在没有FLASK_DEBUG
的情况下启动烧瓶应用程序时,它会正常启动。但是,当我尝试设置此标志时,会想不通,并且不再起作用。
我尝试放下venv并再次创建,尝试再pip install flask
一次,结果是相同的。
命令行(上次未设置FLASK_APP
,但工作方式相同)
(venv) D:\Python\microblog>flask run
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [18/Aug/2019 20:59:35] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [18/Aug/2019 20:59:37] "GET /user/healplease HTTP/1.1" 200 -
127.0.0.1 - - [18/Aug/2019 20:59:55] "GET /index HTTP/1.1" 200 -
(venv) D:\Python\microblog>set FLASK_DEBUG=1
(venv) D:\Python\microblog>flask run
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Restarting with stat
d:\python\microblog\venv\scripts\python.exe: No module named D:\Python\microblog\venv\Scripts\flask
我希望应用程序能够像往常一样启动,但是应用程序根本不会启动:^(