How to use Visual Studio code to debug django

I am new to django development and came from developing desktop / mobile apps with Xcode and their associated IDE.

I had to use Django, and I was wondering if there is an efficient way to debug using Visual Studio (or Atom ) code .

Any help related to the Django IDE would also be helpful.

+13
source share
3 answers

For VSCode (full disclosure, I am one of the VSCode developers), try installing the Python extension to get started.

This documentation describes debugging Django . Debug configuration must be enabled or you can add your own file launch.json:

{
    "name": "Django",
    "type": "python",
    "request": "launch",
    "stopOnEntry": false,
    "pythonPath": "${config.python.pythonPath}",
    "program": "${workspaceRoot}/manage.py",
    "args": [
        "runserver",
        "--no-color",
        "--noreload"
    ],
    "debugOptions": [
        "WaitOnAbnormalExit",
        "WaitOnNormalExit",
        "RedirectOutput",
        "DjangoDebugging"
    ]
}

The Python extension also provides many other features that you might find useful.

Hope you get started.

+28
source

Only the experimental configuration works for me .

{ "name": "Django", "type": "pythonExperimental", "request": "launch", "program": "${workspaceFolder}/manage.py", "args": [ "runserver", "--noreload", "--nothreading" ], "django": true },

Standard configuration causes a Unverified breakpointproblem Unverified breakpoint.

+1
source

Source: https://habr.com/ru/post/1662671/


All Articles