9
votes

I'm seeing some bizarre behaviour in PyCharm. I have a Django project where breakpoints stopped working in some files but not others. For example, all the breakpoints in my app's views.py work fine, but all the breakpoints in that same app's models.py are just ignored.

I've tried the following but no joy:

  • double-check the breakpoints are enabled
  • removing/re-adding the breakpoints
  • closed/re-opened the project
  • quit & re-launch PyCharm
  • delete my configuration and create a new one

Some details:

  • PyCharm 2.7.3
  • Python 2.7.2 (within virtualenv)
  • Django 1.5.1

I'm not using any special settings in my configuration. Any ideas?

5
Any symlinks in the project paths? If you have a reproducible test case, file a bug.CrazyCoder
No symlinks, and I cannot reproduce on a different machine nor with a different project on the same box. Thanks though.Fiver

5 Answers

13
votes

If you have the setting "Gevent compatible debugging" enabled it does not seem to hit breakpoints in a non-Gevent django application.

Find it under Preferences -> Python Debugger -> Gevent compatible debugging

5
votes

While I don't know why or how, the problem was resolved by deleting the ".idea" directory within the Django project directory. This is where the PyCharm project data lives, so by removing this directory you will lose your project specific settings, so just be aware. Hope this helps someone else.

1
votes

Make sure that the breakpoint is not located in a project (dependency) directly symlinked from the project (the main project) that uses the symlinked project. I say directly, because PyCharm does follow breakpoints in symlinked projects located in site-packages, but this is an indirectly simlinked project.

Ex:

Scenario 1

Project A

  • ProjB_SymLink

Site-Packages

  • Other Packages

Scenario 2

Project A

Site-Packages

  • ProjB_SymLink
  • Other Packages

In Scenario 1, PyCharm will not see breakpoints located in code under Project B. In Scenario 2, it will.

The below also should be useful: http://devnet.jetbrains.com/thread/442551

1
votes

In my case, setting the "No reload" option in the run/debug configuration solved the problem. I'm using python 3.8.

-1
votes

Just like other folders on the left side of your project, there will be a '.idea' folder on the top must be there. Delete that '.idea folder'. Close the project. Open it again. It solved my issues.