Skip to content
Advertisement

How to configure Visual Studio Code to debug Django app in a virtualenv?

I would like to have possibility to do a debugging of Django application in Visual Studio Code. I have a virtualenv, made a change in launch.json file that look like this:

JavaScript

put several break points in the code and run it. Unfortunately, the execution is not stopped on the line with break points. I tried the same without virtualenv and everything worked perfectly.

Please, point out what I am doing wrong here.

Advertisement

Answer

For me, the following 2 changes worked

  1. Add an absolute path for pythonPath
  2. Use the "--noreload" option while starting the project

Here’s the relevant part of my config

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement