One Developer Can't Set Breakpoint in Django Templates

已回答

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!

 

0

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

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

0
Avatar
Permanently deleted user

No solution yet.

0
Avatar
Permanently deleted user

I have the same issue with PyCharm Professional 2019.2

0
Avatar
Permanently deleted user

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

0

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

I had the same issue and it was fixed by changing settings. Settings -> Template Languages -> Template Language set to Django (originally was Jinja2).

Here is another explanation https://stackoverflow.com/a/43839057/6489722

2

Stanislav Savchuk's fix worked for me. Thank you very much

1

请先登录再写评论。