View on GitHub


django-pagination for bootstrap pagination layout

Download this project as a .zip file Download this project as a tar.gz file

Welcome to django-bootstrap-pagination

It is a fork from ericflo/django-pagination to fit bootstrap pagination layout


Clone the repo

$ git clone git://

and install

$ cd django-bootstrap-pagination/
$ python install

You may need to have root access, then use sudo python install instead

In your add to your INSTALLED_APPS bootstrap_pagination




and to your MIDDLEWARE_CLASSES add 'bootstrap_pagination.middleware.PaginationMiddleware'




How to use

In your view use

def view(request, query):
    users = User.objects.filter(first_name=query)
    return render_to_response("template.html", { 'users':users }, context_instance=RequestContext(request))

... or whatever you want

In your template use

<!-- load tags and filters -->
{% load pagination_tags %}

   users: the list to paginate
   20: results per page
  {% autopaginate users 20 %}

  {% for user in users %}
    <li>{{ user.username }}</li>
  {% empty %}
    No results...
  {% endfor %}

  <!-- navigation -->
  {% paginate %}  


Then run the server !

How it looks like?

bootstrap pagination image

Authors and Contributors

Forked from (@ericflo)'s django-pagination