All,
How Can we increment a value like the following in django templates,
{{ flag =0 }} {% for op in options %} {{op.choices}}
You explicitly can't do that in a template. Variable assignment is not allowed.
However if all you want is a counter in your loop, you just need to use {{ forloop.counter }}.
{{ forloop.counter }}