Created
July 17, 2024 19:10
-
-
Save AliciaMoses/e29fc90c78186606b5a480e40f1ced61 to your computer and use it in GitHub Desktop.
VSCode Pytest + Django Launch Config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Test Current File", | |
"type": "debugpy", | |
"request": "launch", | |
"module": "pytest", | |
"args": [ | |
"${file}", | |
"--create-db", | |
"-p no:pytest-pycharm", | |
"-p no:pycharm", | |
"--color=yes", | |
], | |
"console": "integratedTerminal", | |
"cwd": "${workspaceFolder}", | |
"django": true, | |
"env": { | |
"DJANGO_SETTINGS_MODULE": "FOO", | |
"DJANGO_CONFIGURATION": "BAR", | |
}, | |
}, | |
{ | |
"name": "Test Management Command", | |
"type": "debugpy", | |
"request": "launch", | |
"program": "${workspaceFolder}/src/manage.py", | |
"env": { | |
"DJANGO_CONFIGURATION": "FOO" | |
}, | |
"args": [ | |
"FILENAME_WITHOUT_EXTENSION" | |
], | |
"console": "integratedTerminal" | |
}, | |
{ | |
"name": "Test App via Client", | |
"type": "debugpy", | |
"request": "launch", | |
"program": "${workspaceFolder}/src/manage.py", | |
"args": [ | |
"runserver", | |
"8002" // Port number of choice | |
], | |
"envFile": "${workspaceFolder}/.env", | |
"django": true, | |
"justMyCode": false, | |
"env": { | |
"DJANGO_SETTINGS_MODULE": "FOO", | |
"DJANGO_CONFIGURATION": "BAR", | |
} | |
}, | |
], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment