{% if movies.has_other_pages %}
<ul class="pagination">
{% if movies.has_previous %}
<li class="pagination-item">
<a href="?page={{ movies.previous_page_number }}">Previous</a>
</li>
{% else %}
<li class="pagination-item">
<a>Previous</a>
</li>
{% endif %}
{% for i in movies.paginator.page_range %}
{% if movies.number == i %}
<li class="pagination-item current-page"><a>{{i}}</a></li>
{% else %}
<li class="pagination-item"><a href="?page={{i}}">{{i}}</a></li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
我正在尝试在Django中使用分页器,但似乎出了点问题,但我似乎无法弄清楚。