【发布时间】:2019-11-13 11:25:29
【问题描述】:
我添加了一个启动配置,允许我在 Django 中运行所有测试,另一个允许我运行服务器,这两个都可以正常工作。
我正在寻找一种调试单个文件的方法,但在参数中使用 ${file} 会给出 django 不喜欢的正常路径。
我想要一种将${file} 更改为python 路径的方法,以便我可以在单个文件上调试我的测试。
python manage.py test --noinput --keepdb python.path.to.my.file
在命令行中工作。
下面的配置好像差不多:
{ "name": "Test File",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
"args": [
"test",
"--noinput",
"--keepdb",
"${file}"
],
"django": true
}
但是,当我运行此配置时出现错误,
我认为这是因为${file} 变成了
path/to/my/file 而不是path.to.my.file。
【问题讨论】:
标签: python django visual-studio-code vscode-debugger