Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Simple pagination app that saves your time.

Project description


Build Status Coverage Status PyPI version

django-cool-pagination is simple pagination app that saves your time.


The project is still on development stage, some things may not work properly.


Currently it supports Bootstrap 4.x only. So that you have to add Bootstrap4 to your project.


  • Dynamic query string creation
  • Length auto control
  • Fully customizable (aspiring)




pip install django-cool-pagination

git clone
cd django-cool-pagination
python install

Setting up



Make sure request is in context_processors

    'context_processors': [



FBV (Function based view)

def listing(request):
    contact_list = Contacts.objects.all()
    paginator = Paginator(contact_list, 25)

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

CBV (Class based view)

class Listing(ListView):
    model = Item
    paginate_by = 5


{% load cool_paginate %}

{% for contact in page_obj %}
{% endfor %}

{% cool_paginate page_obj=ENTER HERE YOUR PAGE OBJECT! %}

Note: You don't have to specify page if its name is page_obj as default.


You can customize it so that it works as you want. Customize it by defining settings either in or inside of {% cool_paginate %}

COOL_PAGINATOR_NEXT_NAME - Name for "next" button in pagination bar.
COOL_PAGINATOR_PREVIOUS_NAME - Name for "previous" button in pagination bar
COOL_PAGINATOR_SIZE - Size of pagination bar (choose: "LARGE" or "SMALL")
COOL_PAGINATOR_ELASTIC - What page width is elastic mode enabled from?

{% cool_paginate page_obj next_name previous_name size elastic %}

page_obj - Type here your page object.
next_name - Name for "next" button in pagination bar.
previous_name - Name for "previous" button in pagination bar
size - Size of pagination bar (choose: "LARGE" or "SMALL")
elastic - What page width is elastic mode enabled from?

Note: {% cool_paginate %} has a priority, django-cool-pagination will firstly look at this, after at


This project is licensed under the MIT License - see the LICENSE file for details

inspired by inoks/m3u8

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-cool-pagination, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size django-cool-pagination-0.3.0.tar.gz (7.3 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