DEV Community

Discussion on: Debug Python and Django easily from Visual Studio Code

Collapse
javaguirre profile image
Javier Aguirre Author

Thank you! There is actually! :-)

As you may know you can use
python manage.py test
to run all your tests, so from VS Code you could use it like:

{
    "name": "Django: Test",
    "type": "python",
    "request": "launch",
    "program": "${workspaceFolder}/manage.py",
    "env": {"DJANGO_SETTINGS_MODULE": "myproject.settings.test"},
    "args": [
        "test"
    ],
    "django": true
}

you can put it on your launch.json and you’re good to go!