Even after making several changes to adapt the code to Python version 3.10, used in Alpine container, and Django 4.0, since my code was for Python version 3.8 and Django 3.0.8, the problem remains. It seems to be related to timeout.
Note, error messages no longer appear in the output of the “Debug Console” section.
I also got it with debupy by adding the line, below, in the wsgi.py file, but the debug auto-terminate issue remains
I managed to run ptvsd, related to the same project as debugpy, but I still have a problem with the debugger finishing in a short time, a few seconds. Here’s the new snippet in wsgi.py for Gunicorn:
Using Telnet localhost port, I found that debugpy is only running by Django shell’s interactive mode, but I still haven’t resolved it.
Here are my docker-compose.yaml, Dockerfile, manage.py and launch.json for those who can tell me where the error is, because when I start debugging, VS Code seems to start the debug, but it ends. Below, a link to a file composed of the 4 files mentioned: