我有一个带有devcontainer.json和launch.json的设置,并且在vs-code中有新的Remote Container插件。但是我无法使断点正常工作。我启动了应用程序并可以浏览它,但是断点没有命中,我的launch.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: Django",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
"args": [
"runserver",
"0.0.0.0:8000",
],
"env": {
"PYTHONUNBUFFERED": 1,
"ENV": "local",
"DJANGO_SITE_ID": 1,
"DJANGO_SETTINGS_MODULE": "project.settings.local1",
}
}
]
}
答案 0 :(得分:1)
您的配置与Django的默认launch.json
配置不同,并且缺少了一些关键部分(看起来丢失的所有内容都很重要):
{
"name": "Python: Django",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
"console": "integratedTerminal",
"args": [
"runserver",
"--noreload",
"--nothreading"
],
"django": true
},