Skip to main content

Pagination.

Project description

# django-pager

Pagination.

## Installation

pip install django-pager

## Configuration

settings.py

INSTALLED_APPS = (
...
'django_pager',
)



## Usage

views.py

from django_pager import paginate

def listing(request):
qs = Contact.objects.all()
page = request.GET.get('page', 1)
contacts = paginate(qs, page, 10)
# You can also get page numbers reversed
# contacts = paginate(qs, page, 10, reverse=True)
return render_to_response('list.html', {"contacts": contacts})


list.html

{% include 'django_pager/pager.html' with objects=contacts %}

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-pager, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size django-pager-0.1.1.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page