<div class="pagination">
    <span>
        {% if page_obj.has_previous %}
            <a href="{% querystring page=1 %}">&laquo; first</a>
            <a href="{% querystring page=page_obj.previous_page_number %}">previous</a>
        {% endif %}

        <span>
            Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
        </span>

        {% if page_obj.has_next %}
            <a href="{% querystring page=page_obj.next_page_number %}">next</a>
            <a href="{% querystring page=page_obj.paginator.num_pages %}">last &raquo;</a>
        {% endif %}
    </span>
</div>
