Saturday 2 January 2021

Pycharm CE not hitting breakpoints in my Django project

I have my project properly configured to run manage.py in the right place, with the right settings.

picture of project configuration

I also have debug breakpoints set in a method that I know with certainty is being executed (I've put a print statement there and it executed as expected). The breakpoints are not disabled or conditional:

picture of breakpoints in code

When I hit the "Run in debug mode" button, using the above run configuration (I'm sure it's the same one because it's the only one I've configured for this project), this is the console output I get:

pydev debugger: process 38083 is connecting

Connected to pydev debugger (build 192.5728.105)
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
December 23, 2020 - 19:22:22
Django version 3.1.4, using settings 'FEArena.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

When I tried putting a breakpoint in manage.py, it worked as expected, triggering just when I hit the 'debug' button. However, after the app has started, when I use a REST client to trigger the above method, the one with breakpoints in it, the breakpoints do not trigger and the debugger doesn't start. I get a 200 OK response in my REST client, but PyCharm does not stop and execute the debugger at any point.

I looked at other answers that advised setting "Gevent compatible debugging" (which I don't have, because I'm using Community Edition), and I've tried deleting the .idea/ folder for the project, which also didn't fix the issue. I'm not sure what else could be causing this. I just want to debug my program.

My PyCharm version information is

PyCharm 2019.2 (Community Edition)
Build #PC-192.5728.105, built on July 23, 2019
Runtime version: 11.0.3+12-b304.10 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.15.7
GC: ParNew, ConcurrentMarkSweep
Memory: 4029M
Cores: 8
Registry: 
Non-Bundled Plugins: com.karateca.jstoolbox, mobi.hsz.idea.latex, net.seesharpsoft.intellij.plugins.csv, nl.rubensten.texifyidea, org.intellij.plugins.markdown

What could be causing the breakpoints to not be triggered, and how do I fix this? I need breakpoints to debug other parts of my program.



from Pycharm CE not hitting breakpoints in my Django project

No comments:

Post a Comment