Django Admin Lists
list_display chooses useful columns, search_fields defines supported searches and list_filter gives staff explicit filtering controls. Keep labels tied to the actual task.
How it works
A workshop administrator needs its title, venue and seat counts rather than only an opaque object id. list_select_related avoids an extra venue query for every displayed row. Search fields should be bounded and indexed appropriately as the dataset grows. prepopulated_fields suggests a slug in the browser but is not a uniqueness guarantee. The server and database still validate the saved record.
Run in the supplied local Django project
This lesson uses Django 5.2.18 LTS with Python 3.12. Download the source downloader and run node download-project.mjs http://127.0.0.1:8000 with Node 22 while previewing locally. It creates a new bhylu-django-lab folder and refuses to overwrite an existing one. After deployment, the default base is bhylu.com; until then use your local preview URL.
Inside that new folder, create a virtual environment, install requirements.txt and run the complete lesson file shown below. Every lesson creates a fresh in-memory SQLite database and temporary upload storage. It does not edit the interactive lab’s db.sqlite3 or Bhylu’s database. The visible listing below is the lesson’s core code; its complete downloaded file includes the shared bootstrap.
Django does not run in Bhylu’s current browser playground. No Apache, MySQL or global PHP configuration change is needed. See the setup lesson for the full project and commands.
Example
Run .venv\Scripts\python.exe lessons\admin-lists.py from the downloaded project root. Download the complete lesson file; keep it under lessons/. The project’s shared models, forms, views and fixture are prerequisites, not a hidden online runtime.
from django.contrib import admin
model_admin = admin.site._registry[Workshop]
print("remaining" in model_admin.list_display)
print(model_admin.search_fields)
print(model_admin.list_select_related)
print(model_admin.prepopulated_fields["slug"])
Expected result
True ['title', 'slug'] ['venue'] ['title']
The configuration follows the operations staff actually need. These metadata checks are paired with real admin page and CRUD tests in the project review; they alone would not prove the interface works.
Use Django’s versioned official documentation for exact API contracts and the deployment checklist before a separate release.