Django app for building HTML listings / tables


Install with pip:

pip install django_listing

Then declare the app in your



The very basic setting is to create a view from the TemplateView class.


from django.views.generic import TemplateView
from demo.models import Employee

class BasicUsageListingView(TemplateView):
    template_name = 'demo/basic_usage.html'
    extra_context = dict(employees_as_model=Employee) # See 'Employee' definition in "Read me first" at home page.

In this exemple, Employee is a model and is exported as employees_as_model into the template demo/basic_usage.html. If you want, you can also use get_context_data() method instead of extra_context attribute.

As usual, you attach the view to an url in

from .views import *

urlpatterns = [
path('basic_usage/', BasicUsageListingView.as_view(),

It is time to define the template demo/basic_usage.html:

{% load django_listing %}
<link rel="stylesheet" href=""/>
{% render_listing_header %}
{% render_listing employees_as_model per_page=5 %}
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>
{% render_listing_footer %}

You need to load django_listing tags at the very begining of the template, then include {% render_listing_header %} template in the <HEAD>...</HEAD> part of the template, and {% render_listing_footer %} template at the very end of the <BODY>...</BODY> part of the template. This will automatically add necessary CSS and JS in your page. Then you can use the {% render_listing ... %} tag where you want to display the listing. First parameter must be a Django model, a queryset, an iterable or a Listing instance. Some parameters can be added : here the listing will have 5 rows per page.

Note : jquery, popper, bootstrap and datetimepicker javascripts are not mandatory for basic listings


Actually, the detailed documentation is under construction. The best way to see how to use django-listing is to see the demo code here : django-listing-demo

If you have docker you can run the demo with this command:

docker run -p 8123:8123 elapouya/django-listing-demo

And then open your browser at this url : http://localhost:8123

To install docker on Linux, just use this command:

curl -sSL | sh

Otherwise, you can upload from here :

Indices and tables