Visual Studio Code调试Python(launch.json)

参考配置1(调试Dify)

{
    "version": "0.2.0",
    "configurations": [        
        {
            "name": "Python Debugger: Flask",
            "type": "debugpy",
            "request": "launch",
            "module": "flask",
            "env": {
                "FLASK_APP": "app.py",
                "FLASK_DEBUG": "1"
            },
            "args": [
                "run",
                "--host",
                "0.0.0.0",
                "--port=5001",
                "--debug"
            ],
            "jinja": true,
            "autoStartBrowser": false,
            "cwd": "${workspaceFolder}/api",
            "gevent": true
        }
    ]
}

参考配置2(调试Python文件)

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python Debugger: Current File",
            "type": "debugpy",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "cwd": "${workspaceFolder}/app/examples",
            "justMyCode": false
        }
    ]
}