PyCharm 2022.1.2 does not hit the debug breakpoint with Django

I can't get Python debugger to work on PyCharm 2022.1.2 with Django 4. When I set the breakpoint inside the view function and then call this view in the browser, nothing happens when started in debug mode...

breakpoint_selected

However breakpoint is hit when I set it for import.

breakpoint_hit

I have 2 configurations, one for Python and one for Django Server, both don't work.

config1 config2

Went through numerous JetBrains tickets with people reporting similar problem but didn't find the solution there. Also tried creating second run configuration, for Python instead Django Server, but this also didn't help.

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.

Back to Top