Pycharm not recognizing django template tags

I had to reinstall my mac osx and on installed a fresh copy of pycharm. I cloned a git django project and I loaded the project using open directory and it didn't recognize it. Then I ticked enable django support and everything works, I can run and stuff, except that the IDE is not recognizing my template tags such as {% for ... %} and it is not creating the closing brackets automatically. Further, the syntax highlight for the template tags are not working as well.

Any solutions?

14 comments
Comment actions Permalink

Please make sure that the Django template format is selected under Settings | Template Languages.

1
Comment actions Permalink

I'm having the same problem and my Template Language is set to Django.

0
Comment actions Permalink

Ralph,

Could you please attach a screenshot demonstrating the problem?

0
Comment actions Permalink

no template highlighting.tiff

Attached screen shot show template settings and template file open in editor. Highlighting not being applied.



Attachment(s):
no template highlighting.tiff
0
Comment actions Permalink

I'm sure it's got something to do with the .idea directory.

I tried everything, even opening my other django project that has everything working and setting the exact same settings. It still doesn't work. So in the end I deleted the default .idea directory and copied over the .idea from the django project that was working. I opened up the project, a few errors popped up and after that everything was working fine.

0
Comment actions Permalink

Please map the .djt extension to the HTML file type in Settings | FIle Types.

0
Comment actions Permalink

Problem solved. Thanks!

0
Comment actions Permalink

I have the exact same problem. My Template Language is set to Django and I've mapped the *.djt extensions to the HTML file type in Settings | File Types. Still, no template tags are being highlighted. What's more, line comment or code formatting are not working in my HTML files. 

0
Comment actions Permalink

@Martyszek

Please provide screenshots to demonstrate the issue and **idea.log** file, which you can find using **Help > Show log in...** action.

Ensure that you have HTML Tools plugin enabled.

0
Comment actions Permalink

Hi i have the same problem, i've checked that html plugin is enabled and in the settings there is an extension *.djt, but the problem isn't solved. I attached a screenshot.

0
Comment actions Permalink

Template tags are not recognized, please notice also the changed icon of the .html file. I've done all of the above, nothing seemed to be the case.

0
Comment actions Permalink

Do you have Vue.js plugin installed?
There is a known issue with it https://youtrack.jetbrains.com/issue/PY-41619

2
Comment actions Permalink

If Vue.js plugin installed

Add Vue.js template in Settings | Languages & Frameworks | Template Languages | Template File Types it's fix Django template support

4

Please sign in to leave a comment.