python - VS Code Flask 调试
问题描述
在 Windows 10 上烧瓶新手。
我正在阅读基本的Flask 教程,但运行调试器的输出始终是这样的:
& 'C:\Users\User\AppData\Local\Programs\Python\Python38\python.exe' 'c:\Users\User\.vscode\extensions\ms-python.python-2020.7.96456\pythonFiles\lib\python\debugpy\launcher' '51698' '--' '-m' 'flask' 'run' '--no-debugger' '--no-reload'
* Serving Flask app "app.py"
* Environment: development
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
主调试 UI 控件 Step into、Step out 和 Step over 显示为灰色。键盘快捷键也不起作用。
所有设置和配置都是默认选项,我尝试过使用虚拟环境,但没有。使用 Python 64 位 v3.85。调试配置 = Python:烧瓶。启动.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Flask",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "app.py",
"FLASK_ENV": "development",
"FLASK_DEBUG": "0" // Also tried with "1"
},
"args": [
"run",
"--no-debugger",
"--no-reload"
],
"jinja": true
}
]
}
我错过了什么?任何帮助表示赞赏。
解决方案
解决了:
这是工作。我必须打开浏览器到正确的页面(在本教程中为 localhost:5000/hello/),调试器才能激活。
推荐阅读
- ios - 初始化程序 'init(_:)' 要求 '(UITextRange) -> String?' 符合 'BinaryInteger'
- reactjs - Typescript中泛型格式的歧义
- java - Spring Cloud Stream - 依赖问题
- reactjs - React Native Async Storage 设置项功能
- javascript - 查看 Cloudflare Workers 的错误日志(错误 1101)
- c# - SSH Remote 在 Oracle Linux 7 上获得更少的环境变量
- c - c中的中止调用损坏的大小与prev_size错误
- regex - find 命令不能排除确切的正则表达式
- delphi - 如何准确计算备忘录中的单词?
- r - 从导入的 .csv 文件中删除 NaN 行