Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm - some breakpoints not working in a Django project

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?

like image 997
Fiver Avatar asked Jul 16 '13 16:07

Fiver


People also ask

Is PyCharm good for Django?

One of the features of PyCharm is that it includes a support for Django. With the ability of including JavaScript features within PyCharm, it can be considered as the best IDE for Django.


2 Answers

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.

like image 164
Fiver Avatar answered Oct 23 '22 00:10

Fiver


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

like image 22
Edhowler Avatar answered Oct 22 '22 22:10

Edhowler