loading...

re: Debug Python and Django easily from Visual Studio Code VIEW POST

FULL DISCUSSION
 

Nice article! I will try that for sure since I work with Django. I was wondering if there is any way for running unit test and functional test. I currently use Intellij Idea, while the cost is a bit high for me, it is really powerful. I'm willing to try new products.

 

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!

Code of Conduct Report abuse