{% extends "base.html" %} {% block content %} {% for item in items %} {% ifchanged item.week %} <h2>{{ item.year }} week {{ item.week }}</h2> {% endifchanged %} {% include "listitem.html" with item=item %} {% endfor %} {% endblock %}