Debugging is a big deal?

Ok, I wasted a fair bunch of hours trying to make it work with the way that the django videos suggests but it didn’t work for me. that included fiddling with the launch.json in so many different ways, running as admin, re installing vs code.

My best guess is that the vscode project debugger is not picking up either the env or the interpreter correctly. Tried explicitly stating those in the launch.json and didn’t work either.

My solution

When starting the project don’t use pipenv in the way recommended. I’m assuming there must be a way to create your env using pipenv within your project folder but that’s beyond me.

  1. When starting your project folder in vscode, create a virtual environment using .venv by typing type ctrl+shift+p and select Python:Create environment
  2. Select venv, then it will prompt you to select the desired pytho version
  3. do ctrl+shift+p again and select python:select interpreter
  4. This should create a bunch of env files making you env ready to use
  5. install pip install django using the terminal which should already have your new env

Then you should be able to use pip instead of pipenv to install everything in your venv and also the debugger should run swiiftly as it does in the tutorial

Reference: Using Python Environments in Visual Studio Code