how to run this code in django template
The template subsystem has some special constructs built into the for/endfor block that allows you to access the current index of the loop without having to call enumerate. {% for j in a %} {{ forloop.counter0 }}, {{ j }} {% endfor %} While this snippet solves your immediate problem, if you’re expecting to have … Read more