{% if page_obj.has_next or page_obj.has_previous %}
Страницы {% if page_obj.has_previous %} Ctrl  {% else %} Ctrl предыдущая {% endif %} {% if page_obj.has_next %}  Ctrl {% else %} следующая Ctrl {% endif %}
{% for p in previous_list|slice:"-8:" %} {% if forloop.first and previous_list|slice:":-8" %}...{% else %}{{ p }}{% endif %} {% endfor %} {{ page }} {% for p in next_list|slice:":8" %} {% if forloop.last and next_list|slice:"8:" %}...{% else %}{{ p }}{% endif %} {% endfor %}
{% endif %}