{% if history.has_previous %} << Previous {% else %} << Previous {% endif %} | {% if first_page_link %} {{ history.paginator.page_range|first }} | ... | {% endif %} {% for page in pages %} {% ifequal page history.number %} {{ page }} {% else %} {{ page }} {% endifequal %} | {% endfor %} {% if last_page_link %} ... | {{ history.paginator.page_range|last }} | {% endif %} {% if history.has_next %} Next >> {% else %} Next >> {% endif %}