Reputation: 339
launch.json
"name": "Django",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config.python.pythonPath}",
"program": "${workspaceRoot}/manage.py",
"cwd": "${workspaceRoot}",
"args": [
"runserver",
"--noreload"
],
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput",
"DjangoDebugging"
]
In the browser http://localhost:8000/login
I have a login page allow user input username and password to login. I put a break points in the code of def login
in views.py and run debug but the execution is not stopped on the line with break points. Now I want to allow user input user name and password then they click on button and it will jump to break points def login
in views.py. How can I do that?
Upvotes: 5
Views: 5486
Reputation: 658
Here are instructions for Visual Studio Code version 1.14.2. Older versions may work a bit different.
VS Code will open manage.py and start execution. There should be a debugger tool pallet at the top of the IDE with buttons to step, continue, etc. Breakpoints are set by clicking in the code window to the left of the line number.
I have these VS Code extensions installed (in case it matters).
Upvotes: 7