
<div style="text-align: center; margin: 1rem 0;">
{% if page_obj.has_previous %}
<a href="{% url 'articleapp:list' %}"?page="{{ page_obj.previous_page_numer }}"
class="btn btn-scondary rounded-pill">
{{ page_obj.previous_page_number }}
</a>
{% endif %}
<a href="{% url 'articleapp:list' %}"?page="{{ page_obj.number }}"
class="btn btn-scondary rounded-pill active">
{{ page_obj.number }}
</a>
{% if page_obj.has_next %}
<a href="{% url 'articleapp:list' %}"?page="{{ page_obj.next_page_numer }}"
class="btn btn-scondary rounded-pill">
{{ page_obj.next_page_number }}
</a>
{% endif %}
</div>
page 오브젝트에서 has_previous라는 객체가 있는데 현재 페이지에서 이전 페이지가 있는지 없는지 확인하는 불링형 개체이다.
이전 페이지를 가지고 있으면 이전 페이지를 넘어가는 링크를 만들어준다.
has_next는 has_previous의 반대