7

I am using IntelliJ IDEA 13 Ultimate edition with its Python plugin. I opened an existing folder containing a Django project (which I had created using Vim) as an IntelliJ project and enabled the Django facet manually on it. However, my HTML files are still being treated as plain HTML files - Django template tags and syntax aren't recognized. I recall that Django templates were automagically recognized by IntelliJ in an earlier project, but can't reproduce it now.

How can I get IntelliJ to recognize my template files as Django templates, please?

1
  • I'd love to know this too. Commented Jan 16, 2015 at 0:36

1 Answer 1

14

Here's how I did it on IntelliJ IDEA 14 for Jinja2 templates (similar to Django): Settings > Languages & Frameworks > Python Template Languages: Select "HTML files" in the list and choose "Jinga2" for Template Language.

Sign up to request clarification or add additional context in comments.

2 Comments

In IDEA 2016.1.3, I chose "Jinja2" for the Template Language, but my *.html files are still treated as Django templates rather than Jinja2. It only works if I rename the actual files to *.jinja2 (which I don't want).
@Ilya Semenov you should set django not jinja2 in Python Template Languages as mentioned here jetbrains.com/help/pycharm/2016.3/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.