How to change the number of objects (rows) to show in the Django admin change list view?
Change the number of objects (rows) to show in the Django admin change list view
·Dec 16, 2022·
1 min read
Play this article
Note: If you want to read the blog series on Django Admin customization, then click here.
Suppose you have a Book model as given below.
# app_name/models.py class Book(models.Model): ... title = models.CharField(max_length=150) is_active = models.BooleanField(default=True)
You can set
list_per_page to control how many items appear on each paginated admin change list page. By default, this is set to
# app_name/admin.py from django.contrib import admin from django.db import models from app_name.models import Book class BookAdmin(admin.ModelAdmin): ... list_per_page = 250 # You can change this number to mopdify the number of objects(rows)
Any thoughts? Write it down in the comments.
For more such crispy blogs daily, follow Dev.Junction, subscribe to our newsletter and get notified.