{% if is_paginated %}
    <nav aria-label="Page navigation">
      <ul class="pagination">
        {% if page_obj.has_previous %}
            <li>
              <a href="?page={{ page_obj.previous_page_number }}" aria-label="Previous">
                <span aria-hidden="true">&laquo;</span>
              </a>
            </li>
        {% else %}
            <li class="disabled">
              <a href="?page=1" aria-label="Previous">
                <span aria-hidden="true">&laquo;</span>
              </a>
            </li>
        {% endif %}
          {% for page_number in paginator.page_range %}
              {% if page_obj.number == page_number %}
                  <li class="active"><a href="?page={{ page_number }}">{{ page_number }}</a></li>
              {% else %}
                  <li><a href="?page={{ page_number }}">{{ page_number }}</a></li>
              {% endif %}
          {% endfor %}
        {% if page_obj.has_next %}
            <li>
              <a href="?page={{ page_obj.next_page_number }}" aria-label="Next">
                <span aria-hidden="true">&raquo;</span>
              </a>
            </li>
        {% else %}
            <li>
              <a href="#" aria-label="Next">
                <span aria-hidden="true">&raquo;</span>
              </a>
            </li>
        {% endif %}
      </ul>
    </nav>
{% endif %}