Like endif in a Jinja2 flash drive templating engine. Getting TemplateSyntaxError: expected token "end of statement block" token, received "session",

I am building a website using a flash structure , and now I am facing an error that I do not understand. For the simple base.html file that I pasted below, I get tt TemplateSyntaxError: expected token 'end of statement block', got 'session', although I explicitly end the if with {% endif %}.

Does anyone know what I'm doing wrong here?

<!doctype html>
<div class="page">
    <div class="metanav">
        {% if not in session.logged_in %}
            aa
        {% endif %}
    </div>
</div>
+4
source share
1 answer

In the next line, the code does not have an operand for the operator not in.

{% if ?? not in session.logged_in %}
      ^^

Or you can keep in mind the statement not:

{% if not session.logged_in %}
+8

Source: https://habr.com/ru/post/1525037/


All Articles