How to access outermost forloop.counter with nested for loops in Django templates? November 23, 2022 by Tarik You can use forloop.parentloop to get to the outer forloop, so in your case {{forloop.parentloop.counter}}.