jinja2 include template with variables code example
Example 1: how to declare and retrieve variable in jinja template
{% with my_variable="my value" %}
{{my_variable}}
{% endwith %}
{# or #}
{% firstof "my value" as my_variable %}
{{my_variable}}
Example 2: jinja2 include template
{% include "to_be_included.html" with context %}