为python 2.7和Django 1.11设置VSCode调试器

时间:2019-11-10 13:31:02

标签: django python-2.7 visual-studio-code

我已经在带有Microsoft python扩展名的vscode上为现有的django 1,11项目安装了调试器,但这仅适用于http://127.0.0.1:5000/(主页),我需要将此调试器挂接到已经运行的调试器上http://localhost:8000/上的服务器 我需要一个设置,使我可以在vscode上进行调试,使代码在特定的断点处停止,使用Google chrome调试各种URL的代码。 这是我的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",
                "--noreload",
                "--nothreading"
            ],
            "django": true
        }
    ]
}

Python 2.7 Django 1.11 Visual Studio程式码 MacOS卡塔利娜 请帮忙。

1 个答案:

答案 0 :(得分:0)

在设置中使用如下所示的8000

{
    // 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",
                "8000",                    
                "--noreload",
                "--nothreading"
            ],
            "django": true
        }
    ]
}