If you are trying to use VS Code with Gunicorn to debug a Django application this launch.json worked for me.
{
// 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": "Gunicorn: Django ",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/venv/bin/gunicorn",
"gevent": true,
"cwd": "${workspaceFolder}/src",
"args": [
"config.wsgi:application",
"--bind=127.0.0.1:8000",
"--reload",
"--worker-class=eventlet",
"--workers=1",
"--threads=1",
"--timeout=1800",
"--reload-extra-file=${workspaceFolder}/src/assets/templates/base.html",
],
},
]
}
These dependencies are required. Is recommended to add them to a requirements.txt file.
pip install --upgrade -r src/requirements.txt
pip
Django
gunicorn
eventlet
gevent
Gunicorn's --reload-extra-file does not allow wildcards. All extra files (html, css, js, etc.) to be monitored for changes must be added manually.