Python Django Pagination error

Asked 2 years ago, Updated 2 years ago, 102 views

I reported the sample code on the Internet to page on Django

The contents of the first page come out well, but if you press Next, nothing comes out.

In url?I think it's getting weird with page=2, but I don't know what to do.

django pagination python

2022-09-22 20:39

1 Answers

Paginator must be used instead of res

Posts for res and paginator for paginator

The output related to the text is res and you must use a paginator for paging

{% if paginator.has_next %}
    <li><a href="?page={{ paginator.next_page_number }}">Next</a></li>
{% {% endif %}

For more information on pagination, see

https://docs.djangoproject.com/es/1.10/topics/pagination/


2022-09-22 20:39

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.