Flask: WARNING: This is a development server. Do not use it in a production deployment
* Serving Flask app ""welcome.py""
* 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
Usage: flask run [OPTIONS]
Error: Could not import ""welcome.py"".
解决方法
在虚拟环境中执行以下命令设置为开发环境
set FLASK_ENV=development
flask.cli.NoAppException: Could not import “hello.py”".
> set FLASK_APP=hello.py
> set FLASK_ENV=development
> flask run
unindent does not match any outer indentation level
vscode中增加配置,显示控制字符,查看缩进是否正确。我是缩进少打了一个空格,😓
"editor.renderControlCharacters": true,
"editor.renderWhitespace": "all",