【问题标题】:Setup the VSCode debugger for python 2.7 and Django 1.11为 python 2.7 和 Django 1.11 设置 VSCode 调试器
【发布时间】:2019-11-10 13:31:02
【问题描述】:

我已经使用 Microsoft python 扩展在 vscode 上为现有的 django 1,11 项目设置了一个调试器,但这仅适用于http://127.0.0.1:5000/(主页)我需要这个调试器连接到我已经运行的服务器http://localhost:8000/ 我需要一个允许我在 vscode 上调试、使代码在特定断点处停止、使用谷歌浏览器调试各种 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 姜戈 1.11 视觉工作室代码 macOS 卡塔利娜 请帮忙。

【问题讨论】:

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


    【解决方案1】:

    在您的设置中使用 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
            }
        ]
    }
    

    【讨论】:

      猜你喜欢
      • 2018-03-12
      • 1970-01-01
      • 1970-01-01
      • 2019-07-07
      • 1970-01-01
      • 1970-01-01
      • 2018-08-26
      • 1970-01-01
      • 2017-10-21
      相关资源
      最近更新 更多