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

  1. add absolute path pythonpath
  2. 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

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -