for loop counter django template code example
Example 1: template for loop iteration number
{% for item in item_list %}
{{ forloop.counter }} # starting index 1
{{ forloop.counter0 }} # starting index 0
# do your stuff
{% endfor %}
Example 2: forloop counter django
{{forloop.counter}}
Example 3: for loop django template count
{% for item in item_list %}
{{ forloop.counter }} # starting index 1
{{ forloop.counter0 }} # starting index 0
# do your stuff
{% endfor %}