V
V
viktorsmerdin2021-11-09 16:38:45
Django
viktorsmerdin, 2021-11-09 16:38:45

I'm using Pagination Django giving an error when going to the next page?

I'm learning Diango. When using Pagination Django, when going to the next page, it gives an error

Page not found (404)
The page number does not contain the special value “last” and could not be converted to an integer.
Request Method: GET
Request URL: 127.0.0.1:8000/books/?page=%7B%7B%20%20%20%20%20%2...
Raised by: catalog.views.BookListView

Part of my base template:

{% block pagination %}
{% if is_paginated %}


{% if page_obj.has_previous %}
Previous
{% endif %}

Page {{ page_obj.number }} of
{{ page_obj.paginator.num_pages }}.

{% if page_obj.has_next %}
Next
{% endif %}


{% endif %}
{% endblock %}

Why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alternativshik, 2021-11-09
@alternativshik

you have some kind of game in the link, and the formatting is terrible

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question