Does PyCharm support Jinja2?

The mine bottle design uses Jinja2. PyCharm does not automatically recognize and displays lines such as errors. Is there a way to get Jinja2 to work?

+47
python jinja2 pycharm
Apr 01 '13 at 19:44
source share
4 answers

The pro versions support Jinja2, Django and Mako. You can configure the template language in the project settings:

In Python Template Settings the template langauge is set to Jinja2

Community editions may not include certain template languages.

+84
Apr 01 '13 at 19:44
source share

I think it's worth noting that the PyCharm Community edition does not support Jinja2, Mako and Django. It is available only in PyCharm Professional.

See a comparison of the two.

+41
Mar 03 '14 at 18:36
source share

enter image description here Yes, the pro version from pycharm supports Jinja2 to enable it here

From File, open Settings and find the python template in the Languages โ€‹โ€‹and Frames section. Choose Python template languages โ€‹โ€‹from there. Click HTML and select Jinja2 as the template language.

See image for better understanding.

+12
Feb 01 '17 at 16:11
source share

If yoy uses the .jinja extension instead of .jinja2 , it will not work, templates will not be highlighted.

You need to add the file extension to the file types section.

  • Settings> General> File Types
  • Go to the Jinja 2 template
  • Register a new template by clicking +, add *.jinja

enter image description here

+1
Oct 17 '17 at 15:43 on
source share



All Articles