I have a for loop inside another for loop and im trying to get the index (forloop.counter) from the inner loop. Django is for some reason giving me only the outer index. {% for category in categories %} {% for product in products %} {% if product.category.name == category.name %} <p>This is the amount of products inside this category: {{ forloop.counter }}<p> {% endif %} {% endfor %} {% endfor %} Continue reading...