PyCharm reports error when using pipes in Django template

Answered

When using the filtering operator (|) in a Django template this way:

<p>Rendered text with {{ pub_date|date:"c" }}</p>

PyCharm reports an error saying it expects double closing brackets after the key (in this case "date").

This is correct syntax. How can I make it go away?

2 comments
Comment actions Permalink
Official comment

Hello.

Please check you have "Django" template language set in "templates" settings

Comment actions Permalink

Thank you! That was it. For some reason it was set as Jinja2 (is this the default template?).

0

Please sign in to leave a comment.