In a Django template, I want to create a for loop that iterates through a list. During that loop, I also want to be able to use the iteration number of the loop.
For example, if some_list
has 4 elements, then:
{% for o in some_list %}
# Print out the iteration number
{% endfor %}
Should print out the following:
>> 0
>> 1
>> 2
>> 3
How can I do this?