Loops with Jinja
Jinja provides control structures that allow us to loop through lists while rendering the template.
For loops start with {% for my_item in my_collection %}
and end with {% endfor %}
. Here my_item
is a loop variable that will be taking values as we go over the elements. And my_collection
is the name of the variable holding reference to the iterated collection.
Last updated
Was this helpful?