c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
Python

How to customize pagination for django admin?

| | django , python

In this tutorial I will show how to customize pagination for django admin. Django admin already provides pagination by default. It shows 100 per page. Here I Just setting list_per_page=5. You can change this by adding the following line in admin.py file.

django admin pagination

PYTHON CODE:


from django.contrib import admin

from .models import *

class ProductAdmin(admin.ModelAdmin):
list_display = ('name', 'description')
list_per_page=5

admin.site.register(Product,ProductAdmin)

VIDEO GUIDE
: