{% if is_paginated %}
<div class="pagination">
    <span>
        {% if page_obj.first != page_obj.number %}
        <b><a href="{{ page_obj.first_querystring }}">|&lt;</a></b>
        {% endif %}
        {% if page_obj.has_previous %}
        <b><a href="?{{ page_obj.previous_page_querystring }}">&lt;</a></b>
        {% endif %}
        {% for p in page_obj.paginator.pages %}
        {% if p.number == page_obj.number %}
        <b class="selected">{{ p }}</b>
        {% else %}
        <b><a href="?{{ p.number_querystring }}">{{ p }}</a></b>
        {% endif %}
        {% endfor %}
        {% if page_obj.has_next %}
        <b><a href="?{{ page_obj.next_page_querystring }}">&gt;</a></b>
        {% endif %}
        {% if page_obj.last != page_obj.number %}
        <b><a href="?{{ page_obj.last_querystring }}">&gt;|</a></b>
        {% endif %}
    </span>
</div>
{% endif %}
