NelsonLabs
Django/The Admin Panel

The Admin Panel

Django's admin panel is one of its most impressive features โ€” a full CRUD interface for your models, generated automatically. You register your models and it creates the interface.

courses/admin.py โ€” register and customise models
python
from django.contrib import admin
from .models import Course, Category

# Basic registration
admin.site.register(Category)

# Customised admin โ€” control what appears in the admin
@admin.register(Course)
class CourseAdmin(admin.ModelAdmin):
    list_display   = ("title", "category", "level", "is_live", "created_at")
    list_filter    = ("level", "is_live", "category")
    search_fields  = ("title", "description")
    prepopulated_fields = {"slug": ("title",)}  # auto-fill slug from title
    list_editable  = ("is_live",)  # edit without opening the record
    ordering       = ("-created_at",)
Create a superuser to access the admin
bash
python manage.py createsuperuser
# Username: admin
# Email: admin@example.com
# Password: (set a strong one)

# Access the admin at http://127.0.0.1:8000/admin/

TIP

The admin is for you, not your users. Django's admin is a developer/staff tool for managing data โ€” not a user-facing interface. It's perfect for internal teams managing content. For user-facing interfaces, build proper views and templates.