django number for loop code example
Example 1: django template for range
{% with ''|center:n as range %}
{% for _ in range %}
{{ forloop.counter }}
{% endfor %}
{% endwith %}
Example 2: how to count range in django template
{% for item in "x"|ljust:"100" %}
{{item}} {# or do anything 100 times #}
{% endfor %}
Example 3: for loop in django
{% for i in range %}
...
{% endfor %}