The ultimate one-click debug experience for a Django application
#### launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Django_Start",
"python": "/Users/johnsolly/Documents/code/blogthedata/django_project/venv/bin/python3",
"type": "python",
"request": "launch",
"program": "/Users/johnsolly/Documents/code/blogthedata/django_project/manage.py",
"django": true,
"justMyCode": true,
"args": [
"runserver"
],
"preLaunchTask": "LiveReload",
"postDebugTask": "StopTasks"
},
{
"name": "Launch_Chrome",
"request": "launch",
"type": "pwa-chrome",
"runtimeArgs": [
"--incognito",
],
"url": "http://127.0.0.1:8000/",
},
],
"compounds": [
{
"name": "Runserver + Livereload + Chrome",
"configurations": [
"Django_Start",
"Launch_Chrome"
],
"stopAll": true
}
]
}
#### tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "LiveReload",
"type": "shell",
"command": "${config:python.defaultInterpreterPath}",
"args": ["manage.py", "livereload"],
"options": {
"cwd": "${workspaceFolder}/django_project",
},
"isBackground": true,
"problemMatcher": {
"pattern": {
"regexp": "."
},
"background": {
"activeOnStart": true,
"beginsPattern": ".",
"endsPattern": "."
}
}
},
{
"label": "StopTasks",
"command": "echo ${input:terminate}",
"type": "shell",
}
],
"inputs": [
{
"id": "terminate",
"type": "command",
"command": "workbench.action.tasks.terminate",
"args": "terminateAll"
}
]
}
#### Links referenced in video
https://pypi.org/project/django-liver...
https://code.visualstudio.com/Docs/ed...
https://code.visualstudio.com/updates...
https://code.visualstudio.com/docs/py...
https://github.com/microsoft/vscode/i...
https://blogthedata.com (my blog)
Watch video Ultimate One-click Django Debugging. Runserver, livereload, launch chrome all at once! online without registration, duration hours minute second in high quality. This video was added by user John Solly 10 June 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,31 once and liked it people.