Flask + Jinja2 = where's autocomplete?


I try to work in PyCharm with flask. So, i use jinja2 templates.

And i see strange autocomplete behavior:

1. {{}} set connect

2. {%%} - not auto and after last bracket it adds double one - it looks like {%%}}

3. No autocomplete for functions in delimiters.

3.1. At {{}} there are no auto at all

3.2. for {%%} there are autocomplete in some cases, and some are not.

4. {{ endblock }} delimiters and so on highlighting by spellchecker (it doesn't know it's special construction, not typo).


At pics you can see my project settings.



What's going on? Does IDE sees, it's a jinja-template or not?

PS: code stored at git hub.


Comment actions Permalink

Does File | Invalidate Caches / Restart | Invalidate and Restart help?

Try moving the templates folder to the project root and then back to Application.

Has any of it helped?

Comment actions Permalink

When i set templates folder to root - 2 and 4 issue were gone.

But it still can't autocomplete in brackets.

Comment actions Permalink

What do you mean by "set templates folder to root"? Did you move the templates folder to the project root or did you mark the project root as the Template folder?

Make sure File | Settings | Languages & Frameworks | Flask | Flask integration is enabled.

Comment actions Permalink

If u said "move" - i move. So, i moved template folder to project root. See:



And, of course, i use Flask integration from the beginning.

Comment actions Permalink

This is quite an old thread now, but I just ran into this problem...


  1. Go to Preferences > Languages & Frameworks > Flask and ensure the Flask Integration box is checked. Click Apply, click OK.
  2. Go to Preferences > Languages & Frameworks > Template Languages and in the Template Language dropdown, choose Jinja2. Click Apply, click OK.

This fixed things for me. I had created the project from the command line, then  moved into PyCharm to work on it. This seems to have thrown PyCharm a little. ¯\_(ツ)_/¯

Happy coding!


Please sign in to leave a comment.