Chapter 8 of 12
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.
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",)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.