Escaping
It is sometimes desirable – even necessary – to have Jinja ignore partsit would otherwise handle as variables or blocks. For example, if, withthe default syntax, you want to use {{
as a raw string in a template andnot start a variable, you have to use a trick.
The easiest way to output a literal variable delimiter ({{
) is by using avariable expression:
{{ '{{' }}
For bigger sections, it makes sense to mark a block raw. For example, toinclude example Jinja syntax in a template, you can use this snippet:
{% raw %}
<ul>
{% for item in seq %}
<li>{{ item }}</li>
{% endfor %}
</ul>
{% endraw %}