{% load filters %} {% for a in activities %} {% if forloop.counter == activities|length and not is_last_page %}