VSCODE未正确调试枪支

发布于 2025-02-03 20:20:30 字数 957 浏览 4 评论 0原文

因此,经过大量的搜索,我找到了一种使Gunicorn使用以下启动使用VSCODE播放的方法。JSON

        "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Run Debug",
            "cwd": "${workspaceFolder}/dir/dir2",
            "type": "python",
            "request": "launch",
            "program": "/Users/me/.virtualenvs/dir/bin/gunicorn",
            "args": ["--bind 0.0.0.0:6543", "-w=1", "--paste=local.ini" ],
            "console": "integratedTerminal",
            "justMyCode": false,
            "purpose": ["debug-in-terminal"],
            "gevent": true,
            "env": {
                "GEVENT_SUPPORT": "True",
                "PYTHONUNBUFFERED":"1",
                "OBJC_DISABLE_INITIALIZE_FORK_SAFETY":"YES",
                "PYDEVD_LOAD_NATIVE_LIB": "0",
                "PYDEVD_USE_CYTHON":"0"
            }
     }
    ]
}

现在使服务器运行,但它不会输出变量,它不会在任何断点上停止,我看不到任何内容。基本上,整个左窗格都是完全空的。

以前有人成功处理过这个问题吗?

So after much searching I found a way to get gunicorn to play nice with vscode using the following launch.json

        "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Run Debug",
            "cwd": "${workspaceFolder}/dir/dir2",
            "type": "python",
            "request": "launch",
            "program": "/Users/me/.virtualenvs/dir/bin/gunicorn",
            "args": ["--bind 0.0.0.0:6543", "-w=1", "--paste=local.ini" ],
            "console": "integratedTerminal",
            "justMyCode": false,
            "purpose": ["debug-in-terminal"],
            "gevent": true,
            "env": {
                "GEVENT_SUPPORT": "True",
                "PYTHONUNBUFFERED":"1",
                "OBJC_DISABLE_INITIALIZE_FORK_SAFETY":"YES",
                "PYDEVD_LOAD_NATIVE_LIB": "0",
                "PYDEVD_USE_CYTHON":"0"
            }
     }
    ]
}

Now this makes the server run but it outputs no variables, it doesn't stop at any breakpoints, and I can't watch anything. Basically, the whole left pane is completely empty.

Has anyone dealt with this successfully before?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文