8👍
✅
Use {{ forloop.counter }}
inside loop to get the index.
https://docs.djangoproject.com/en/1.5/ref/templates/builtins/#for
1👍
Use {{ forloop.counter }}
.
Source:
Built-in template tags and filters #for
I hope it will solve you problem
- [Django]-Forcing Django to use INNER JOIN instead of LEFT OUTER JOIN
- [Django]-Logging Django Haystack search keyword
- [Django]-Errors When Installing MySQL-python module for Python 2.7
- [Django]-TypeError: at / 'module' object is not callable
Source:stackexchange.com