Django Admin Pagination

Adi Ramadhan
Oct 28, 2022

Django Admin Model List with Pagination.
Using list_per_page in

django admin pagination

Project file structure

Step 1: Preparation, Create Django Project, Inital Migration
create virtualenv: virtualenv venv
start virtualenv: venv/Scripts/activate
install Django in virtualenv: pip install django==3.2
Create Django: django-admin startproject myproject
Go to myproject folder: cd myproject
Initial Migration: python migrate

Step 2: Create Django Apps
Create apps: python startapp myapp
Add myapp to INSTALLED_APPS in myproject/

INSTALLED_APPS in myproject/

Step 3: Add Model


Step 4: Register Model in Django Admin

Highlight: list_per_page


Step 5: Makemigrations and Migrate
Make migrations: python makemigrations
Migrate: python migrate

Step 6: Create Superuser
Create superuser: python createsuperuser
Type username, email password and retype password

Step 7: Run Server and Add Some Data
Run Server: python runserver
Login with superuser and add some data

Django Model Admin List with Pagination