python - How to configure Visual Studio Code to debug Django app in a virtualenv? -
i have possibility debugging of django application in visual studio code. have virtualenv, made change in launch.json file this:
{ "name": "django", "type": "python", "request": "launch", "stoponentry": true, "pythonpath": "${workspaceroot}/.venv/bin/python2.7", "program": "${workspaceroot}/mysite/manage.py", "args": [ "runserver" ], "debugoptions": [ "waitonabnormalexit", "waitonnormalexit", "djangodebugging", "redirectoutput" ] },
put several break points in code , run it. unfortunately, execution not stopped on line break points. tried same without virtualenv , worked perfectly.
please, point out doing wrong here.
were able solve issue?
for me, following 2 changes worked
- add absolute path pythonpath
- use "--noreload" option while starting project
here's relevant part of config
{ "name": "django", "type": "python", "request": "launch", "stoponentry": true, "pythonpath": "/users/xyz/documents/dev/my_project/my_project_env/bin/python", "program": "${workspaceroot}/manage.py", "args": [ "runserver", "0.0.0.0:8080", "--noreload" ], "debugoptions": [ "waitonabnormalexit", "waitonnormalexit", "redirectoutput", "djangodebugging" ] },
Comments
Post a Comment