plantilla de django de paginación adecuada
{% if is_paginated %}
{% load proper_paginate %}
{% load url_replace %}
<ul class="pagination">
{% if page_obj.number == 1 %}
<li class="disabled"><span>⇤</span></li>
{% else %}
<li><a class="page-link" href="?{% url_replace request 'page' 1 %}">⇤</a></li>
{% endif %}
{% if page_obj.has_previous %}
<li><a class="page-link" href="?{% url_replace request 'page' page_obj.previous_page_number %}">«</a></li>
{% else %}
<li class="disabled"><span>«</span></li>
{% endif %}
{% for i in paginator|proper_paginate:page_obj.number %}
{% if page_obj.number == i %}
<li class="active"><span>{{ i }} <span class="sr-only">(current)</span></span></li>
{% else %}
<li><a class="page-link" href="?{% url_replace request 'page' i %}">{{ i }}</a></li>
{% endif %}
{% endfor %}
{% if page_obj.has_next %}
<li><a class="page-link" href="?{% url_replace request 'page' page_obj.next_page_number %}">»</a></li>
{% else %}
<li class="disabled"><span>»</span></li>
{% endif %}
{% if page_obj.number == paginator.num_pages %}
<li class="disabled"><span>⇥</span></li>
{% else %}
<li><a class="page-link" href="?{% url_replace request 'page' paginator.num_pages %}">⇥</a></li>
{% endif %}
</ul>
{% endif %}
WarlordOmar