[Answered ]-PyCharm 2022.1.2 does not hit the debug breakpoint with Django

1👍

Solved this by deleting the .idea directory from top-level django project dir. Not sure what were the mechanics behind it, but it worked and now breakpoints work perfectly.

0👍

I understand the problem is already old, but I just encountered a similar case, so I’ll tell you about it.

The thing is, the PyCharm debugger uses the sys.settrace function to set its own tracing function, so if you have a process that has already captured this API, the debugger does not stop at breakpoints during program execution.

The well-known case is the pytest-coverage module, but I came across another one.

I enabled the django-debug-toolbar-line-profiling module, which similarly captured sys.settrace and displaced the debugger.

So, if your debugger stopped working somewhere, think about which modules might be setting their own tracing function.

👤Eugene

Leave a comment