U
U
Uno di Palermo2019-08-22 16:42:35
Django
Uno di Palermo, 2019-08-22 16:42:35

Why doesn't pagination work in Django (no DB)?

Hello, such a thing: the documentation says: "Note that you can give Paginator a list/tuple, a Django QuerySet, or any other object with a count() or __len__() method"
In docks, the list of objects is created from the database

def listing(request):
    contact_list = Contacts.objects.all()
    paginator = Paginator(contact_list, 25) # Show 25 contacts per page

    page = request.GET.get('page')
    contacts = paginator.get_page(page)
    return render(request, 'list.html', {'contacts': contacts})

And with the help of bs4 I take data from the site through the value of "radio buttons" from html via GET, so the url is like 127.0.0.1:8000/search/?type=manufactured-homes&search=
in pagination page scheme /?page=

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question