While PyCharm Pro might be the most popular IDE for Python development, the community version supports neither Django nor JavaScript . VSCode is a free opensource alternative which has pretty good Python support.Python is supported in VSCode using an extension. A quick start guide on the extension can be found here. It has builtin support for unittest, pytest, and Nose.You can find information about debugging Django using VSCode here. The extension does not have builtin support for Django UnitTests, but we can use pytest to run Django UnitTests. Please make sure that you have installed pytest and pytest-django. They can be installed using pip.pip install pytest pip install pytest-djangoGo to Default Settings and search for ‘python.unitTest’. Change the setting“python.unitTest.pyTestEnabled”: falseto“python.unitTest.pyTestEnabled”: trueCreate a file called ‘pytest.ini’ in your work space root and add the following content to that file. Remember to change the myproject.settings to your actual settings module.[pytest] DJANGO_SETTINGS_MODULE = myproject.settingsWell, That’s all the settings required to run django unit tests. Click the ‘Run Tests’ button on the status bar and select ‘Run All Unit Tests’ from the context menu.Tests will run and the result summary will be displayed on the output tab. If the test output is not visible, select ‘Run Tests’ and select ‘View Unit Test Output’. Summary of the tests can be viewed from the status bar as well. Post navigationAuto registering models in Django Admin Django access control using LDAP
[…] I was always impressed with the simplicity and usefulness of this extension and already wrote a blog post on that. Don definitely deserve this recognition and I am using this opportunity to congratulate […]Reply