How to debug your Django project code happily in VSCode

Installing the Django plug-in

In the VSCode extension, search for Django and click install to install it

The Djnao plugin is a Django extension for Visual Studio code that is used for syntax hints and completion and debugging of Django projects in templates.

Add a Django module to the vscode configuration file

Add according to the order on the screenshot.

The debugger

Next, get down to business and debug the program using VSCode.

  1. Click the debug
  2. Choose a Python: Django
  3. Click Debug. By default, the debug url is 127.0.0.1:8000 port

Once you start debugging, you can insert breakpoints, step, and monitor variables to help you debug your Django projects.