When creating a Jinja template, use {{
and }}
to render a variable.
Example:
Source:
{'name': 'John Doe'}
Template:
<p>Name: {{ data.name }}</p>
Result:
<p>Name: John Doe</p>
Use {%
and %}
to write Python code.
Example
{% if data.name == 'John Doe' %}you again ?{% endif %}
{% for item in data.myList %}<p>{{ item }}</p>{% endfor %}