Skip to main content


Project description

Django NextPage

django-nextpage is modified from django-pagination, but only previous and next page is provided.

Since SQL COUNT statement on large table has poor performance, lots of website turns to show just next and previous page link or button.

How it works?

django-nextpage only execute one SQL statement, no count, no next page determine query.

For example:

If you want to pagiante by 20, django-nextpage will query for 21 items, if queryset length is 21, then we have next page; if queryset length is 20 or less, then we don't have next page.


Add nextpage to INSTALLED_APPS, like:

       # ...

and TEMPLATE_CONTEXT_PROCESSORS should have django.core.context_processors.request, like:



Just like django-pagination, in fact it designed as a drop-in replacement. just load nextpage templatetag

    {% load nextpage %}

    {% autopaginate object_list 20 %}

    {% paginate %}

or you can assign with different pagination template in templates/nextpage folder by

    {% paginate "your_own_pagination.html" %}

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-nextpage, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size django_nextpage-1.0.2-py2-none-any.whl (5.2 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size django-nextpage-1.0.2.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page