{% if page.has_previous %} {# check if we need to call a js function or refresh the current page #} {% if page.paginator.js_callback %} « first previous {% else %} « first previous {% endif %} {% endif %} Page {{ page.number }} of {{ paginator.num_pages }} {% if page.has_next %} {# check if we need to call a js function or refresh the current page #} {% if page.paginator.js_callback %} next last » {% else %} next last » {% endif %} {% endif %}