Django:


template

{\% for image in item.itemimage_set.all \%}
<li data-target="#itemCarousel" data-slide-to=""></li>
{\% endfor \%}

forloop.counter0 is 0-indexed forloop.counter is 1-indexed

more variables in forloop can be found here:

  • forloop.revcounter
  • forloop.revcounter0
  • forloop.first
  • forloop.last
  • forloop.parentloop