One Developer Can't Set Breakpoint in Django Templates

Answered

Hello -

 I have three developers, all on Mac OS 10.14.4 Mojave, and Python 3.6.8 via PyEnv.  They all have PyCharm 2019.1.2 installed via Toolbox.

 Two of them can do these steps:

  1.  File->New Project->Django
  2.  Choose New VirtualEnv (based on ~/.pyenv/versions/3.6.8/bin/python)
  3.  File->New HTML file in the 'templates' dir.
  4.  Add {{ url 'test' }} to body of that file
  5.  Click next to that new line to set a breakpoint
  6.  Run Django with Debug

 

One of my developers can't set the breakpoint for the new line. I've tried it on their machine, and it won't enable setting the breakpoint.

I've tried removing the ~/Library/Preferences/PyCharm20* and ~/Library/Caches/PyCharm20* directories, and deleting and re-installing Python and PyCharm, multiple reboots, etc.

They are able to set breakpoints in .py files just fine, but not Django templates.

Confirmed Python Template Language is set to Django in the newly created project, virtualenv is set, template folder is pink, etc.

Really confused as to why debugging won't work in a brand new project for just this one person! So odd!

 

6 comments
Comment actions Permalink

Hi, make sure template parent folders are not marked as Resource Root (right-click on the folder in the project tree | Mark Directory as ... | Resource Root) as it disables all special Django template features including the debugger. All resources roots should be listed in Settings | Project ... | Project Structure.

0
Comment actions Permalink

I also have the same problem. Non of my folder is marked as parent folder. Did you find a solution yet?

0
Comment actions Permalink

No solution yet.

0
Comment actions Permalink

I have the same issue with PyCharm Professional 2019.2

0
Comment actions Permalink

I have the same issue with PyCharm Professional 2019.2 debugger breakpoint doesn't work, python 3.8 django 2.2.7

0
Comment actions Permalink

The issue with breakpoints in Django projects with Python 3.8 is known and being tracked in https://youtrack.jetbrains.com/issue/PY-38741. The fix is expected in 2019.3.1 version.

Feel free to vote for the ticket and follow it for updates.

0

Please sign in to leave a comment.