What is the best way to get row_num in django ? Can we use a variable as counter in django template tags ?
{% for o in objects %}
<tr>
<td>{{ row_num }}</td>
<td>{{ o.first_name }}</td>
<td>{{ o.last_name }}</td>
</tr>
{% endfor %}
Thanks in advance.
You can use the forloop template tag :