vscode调试同时启动多个程序示例
·
介绍
当使用vscode调试,需要启动多个程序时,可以配置同时启动多个程序。本文提供了配置示例,可供参考。
配置模板
{
// 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": "Celery Worker",
"type": "debugpy",
"request": "launch",
"module": "celery",
"args": [
"-A", "app.task.celery",
"worker",
"-l", "info"
],
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/backend",
"env": {
"PYTHONPATH": "${workspaceFolder}/backend"
},
"consoleName": "Celery Worker",
"justMyCode": true,
},
{
"name": "Celery Beat",
"type": "debugpy",
"request": "launch",
"module": "celery",
"args": [
"-A", "app.task.celery",
"beat",
"-l", "info"
],
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/backend",
"consoleName": "Celery Beat",
"justMyCode": true,
},
{
"name": "Celery Flower",
"type": "debugpy",
"request": "launch",
"module": "celery",
"args": [
"-A", "app.task.celery",
"flower",
"--port=8555",
"--basic-auth=admin:123456"
],
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/backend",
"consoleName": "Celery Flower",
"justMyCode": true,
},
{
"name": "FastAPI Server",
"type": "debugpy",
"request": "launch",
"module": "uvicorn",
"args": [
"main:app",
"--reload"
],
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/backend",
"env": {
"PYTHONPATH": "${workspaceFolder}"
},
"consoleName": "FastAPI Server",
"justMyCode": true,
},
// {
// "name": "Python Debugger: FastAPI",
// "type": "debugpy",
// "request": "launch",
// "module": "uvicorn",
// "cwd": "${workspaceFolder}",
// "args": [
// "backend.main:app",
// "--reload"
// ],
// "jinja": true
// },
],
"compounds": [
{
"name": "All Services",
"configurations": [
"Celery Worker",
"Celery Beat",
"Celery Flower",
"FastAPI Server"
],
"stopAll": true,
}
]
}
更多推荐
所有评论(0)