Diego
Diego

Reputation: 616

How to tell Visual Studio Code to follow Django itself source code while debugging Django applications?

I have a Django application and I set Visual Studio Code to debug it using the default launch.json configuration. When I start the server (manage.py runserver) and make a request, VSCode stops at the first breakpoint (that is correct), but when I step into a function, VSCode never follows/shows Django source code itself and I would like to see what is happening inside that Django source code.

How could I configure VSCode to follow/show Django (and Django REST) source code while debugging Django applications?

EDIT 2019-05-07: With VSCode 1.33.1, the option debugStdLib is obsoleted and it has been replaced by justMyCode, that is exactly the opposite. So to debug Django code, justMyCode has to be set to false in launch.json.

Upvotes: 1

Views: 696

Answers (1)

Don
Don

Reputation: 6872

Once you have debugging working, all you need to do is add the following setting into your launch.json file for the debug configuration used for Django:

"debugStdLib": true,

This flag tells the Python debugger that you wish to debug standard library code.

E.g.:

        {
            "name": "Python: Django",
            "type": "python",
            "request": "launch",
            "debugStdLib": true,

Upvotes: 4

Related Questions