flask项目在vscode中启动调试的配置 发表于 2018-09-19 | 分类于 python | 阅读次数: 使用vscode调试flask项目注意事项 setting.json中,配置venv(虚拟环境)路径:12345678910{ // "python.pythonPath": "/usr/local/opt/python3/bin/python3.6", // 以像素为单位控制字号。 "editor.fontSize": 13, // Whether to lint Python files. "python.linting.enabled": false, "python.linting.pylintEnabled": true, "python.venvPath": "/venv", "python.pythonPath": "${workspaceFolder}/venv/bin/python",} 在launch.json配置文件中,主要更改以下配置123456789101112131415161718192021222324{ "name": "Python: Flask (0.11.x or later)", "type": "python", "request": "launch", "stopOnEntry": false, "pythonPath": "${config:python.pythonPath}", "program": "${workspaceRoot}/venv/bin/flask", // 以上需根据环境的实际路径修改 "cwd": "${workspaceFolder}", "env": { "FLASK_APP": "${workspaceFolder}/run.py", "LC_ALL": "en_US.utf-8", "LANG":"en_US.utf-8" }, "args": [ "run", "--no-debugger", "--no-reload" ], "envFile": "${workspaceFolder}/.env", "debugOptions": [ "RedirectOutput" ]} 本文作者: xiaochao 本文链接: https://www.tinnypea.com/2018/09/the-configuration-of-flask-project-to-start-debugging-in-vscode.html 版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 许可协议。转载请注明出处!