Django Admin Panel
Django Admin Interface
Django’s admin area is a powerful backend system that allows developers to manage data stored in their models. It comes bundled with Django and provides full access to perform Create, Read, Update, and Delete (CRUD) operations directly through the browser.
No coding is needed for this — once set up, the admin dashboard lets you view, add, and modify records visually.
Launching the Admin Dashboard
To begin, ensure your server is running. Step inside myworld/ and spin up the local server using:
python manage.py runserver
After the server boots up, launch your browser and head to:
http://127.0.0.1:8000/admin/
If all is correctly configured, this address will bring up a login page asking for a username and password.
How Django Routes to the Admin Page
The built-in admin path is connected via your project’s URL routing file.
Inside my_tennis_club/my_tennis_club/urls.py you'll see:
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('', include('members.urls')),
Path('admin/', admin.site.urls), ] Here, the line:
path('admin/', admin.site.urls)ensures that any visit to /admin/ on your site is forwarded to Django’s internal admin system. This is part of Django’s core functionality — no need to build it yourself.
Accessing Admin Requires an Account
An administrator account needs to be set up before access to the login is permitted.
python manage.py createsuperuser
It will prompt you to enter:
- Username
- Email address (optional)
- Password
After that, enter the same credentials on the login interface to gain access.
What’s Inside the Admin?
Once authenticated, you’ll be taken to a control panel that lists all the apps and data models registered for administration. You’ll see sections where you can:
- Insert new entries
- View existing records
- Make edits
- Delete items if no longer needed
All changes made here reflect directly in your database.
Secure by Default
The admin panel is not accessible without proper credentials. This guarantees that data actions are restricted solely to verified users.
Summary
- Django ships with a built-in admin UI
- It enables full CRUD access to your app’s models
- The admin path configuration resides within the primary urls.py file.
- Requires creating a superuser to log in
- Simple to use, but very powerful
Prefer Learning by Watching?
Watch these YouTube tutorials to understand HTML Tutorial visually:
What You'll Learn:
- 📌 #19 Django tutorials | Admin Panel
- 📌 Python Django Admin tutorial