How to make a for loop in Jinja?

Jinja2

Jinja2 Problem Overview


I want to make a for-loop that goes from 0 to 10 in Jinja.

How do I do it?
All I know to do is the advanced for, but this does not help me now.

Jinja2 Solutions


Solution 1 - Jinja2

You can create a loop like this:

{% for i in range(11) %}
  {{ i }}
{% endfor %}

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionpromoView Question on Stackoverflow
Solution 1 - Jinja2Andrew KloosView Answer on Stackoverflow