Skip to content
Learn Netverks

Lesson

Step 22/36 61% through track

admin-site

Django admin site

Last reviewed Jun 1, 2026 Content v20260601
Track mode
server_script
Means
Server runner
Reading
~1 min
Level
intermediate

This lesson

This lesson teaches Django admin site: the syntax, APIs, and habits you need before advancing in Django.

The admin site accelerates internal CRUD—know when to customize versus building a separate React admin.

You will apply Django admin site in contexts like: Internal ops panels, content moderation, and support tools without a separate admin SPA.

Write Python 3 in the editor and click Run on server—the dev runner executes your script; Django framework lessons also use local startproject for full MVT (LEARNING_RUNNER_ENABLED=true).

When you can explain the previous lesson's ideas without copying starter code.

Django's admin auto-generates a staff UI for CRUD on registered models—huge productivity win for internal tools and early-stage products.

Registering models

from django.contrib import admin
from .models import Article

@admin.register(Article)
class ArticleAdmin(admin.ModelAdmin):
    list_display = ["title", "published", "created_at"]
    list_filter = ["published"]
    search_fields = ["title"]

Setup

  1. Ensure django.contrib.admin in INSTALLED_APPS
  2. Run migrations (admin tables included)
  3. python manage.py createsuperuser
  4. Visit /admin/

Important interview questions and answers

  1. Q: Admin for public users?
    A: No—staff-only internal tool; build custom views or SPA for customers.
  2. Q: Customize admin?
    A: ModelAdmin options, inlines, actions, custom templates—or third-party packages like django-grappelli.
  3. Q: Permissions?
    A: Django auth integrates—users need is_staff and model permissions.

Self-check

  1. Which file registers models with admin?
  2. What command creates the first admin login?

Tip: list_display, search_fields, and list_filter are the first three ModelAdmin upgrades—staff productivity jumps immediately.

Interview prep

Admin for customers?

No—the admin is staff-only; build custom views or a SPA for end users.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs on the configured server runner (dev: npm run runner with LEARNING_RUNNER_ENABLED=true). Output appears below the editor.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • register ModelAdmin?
  • list_display use?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump