-
Notifications
You must be signed in to change notification settings - Fork 69
Breakpoints aren't being hit in local Django project #1794
Comments
Can you use the env variables and generate the more detailed logs:
Make sure that |
|
@fabioz Can you see anything odd with the logs? @josephlevenson Can you share your project if possible or a minimal repro? |
Unfortunately I can't share my project, i'll try and get a minimal repro |
I tried reproducing the issue on 2 other django projects and could not. The only main difference is that this project uses a DNS |
That should cause an issue with connection. But since it is already connecting, i don't think that is the problem. Lets try this, put these two lines just above the line where you want the breakpoint to hit. import ptvsd
ptvsd.break_into_debugger() |
It's not breaking at all with that. As a sanity check, I added a print statement which is executing:
|
When you said |
This is the command source code.
|
This is the problem. There are two options to address this. Option 1:Change args in launch json to directly launch the above command line: {
"name": "Python: Django",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
"console": "integratedTerminal",
"args": [
"runserver_plus",
"--noreload",
"--nothreading",
"--cert-file",
"cert/server.crt",
"--key-file",
"cert/server.key"
],
"django": true,
"pythonPath": "${workspaceFolder}/.venv/bin/python",
"justMyCode": false
} Option 2If Option 1 is not possible, then see if you can replace {
"name": "Python: Django",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
"console": "integratedTerminal",
"args": [
"httpsrunserver"
],
"django": true,
"pythonPath": "${workspaceFolder}/.venv/bin/python",
"justMyCode": false,
"subProcess", true,
} I removed the |
That did the trick! I didn't think |
Here is my
launch.json
My debug log:
The debugger fires up the server ok and when I have breakpoints set on function definitions and start up code, the breakpoints work fine. Breakpoints that are set in endpoint handlers however, are not being called when the code itself is being executed. The
httpsrunserver
command executespython manage.py runserver_plus --noreload --nothreading --cert-file cert/server.crt --key-file cert/server.key
.OS: macOS Mojave
Python version: 2.7
Django version: 1.11
The text was updated successfully, but these errors were encountered: