About Iterating through QuerySets
To get an index of each item in a QuerySet, use enumerate()
when iterating:
for index1, item in enumerate(queryset, start=1):
print(f"{index1}. {item.title}")
Tips and Tricks Programming Django 4.2 Django 3.2 Django 2.2 Python 3
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django App for You
Django GDPR Cookie Consent app
For Django websites that use cookies.
Django App for You