› Forums › Web Development › HarvardX: CS50W – CS50’s Web Programming with Python and JavaScript › CS50W – Lecture 3 – Django › Django Admin Routes vs Custom Routes: What’s the Difference?
- This topic is empty.
-
AuthorPosts
-
April 27, 2026 at 12:43 am #6458
When beginners see this code in Django:
from django.contrib import admin urlpatterns = [ path("admin/", admin.site.urls), ]they often wonder:
Does importing
admincreate all pages automatically?
And what about my own custom pages?The answer is: yes for admin pages, no for your custom pages.
What Importing
adminDoesThis line:
from django.contrib import adminloads Django’s built-in admin system.
Then this route:
path("admin/", admin.site.urls)connects a full ready-made admin panel to:
/admin/That includes pages such as:
- Admin login page
- Logout page
- Password change page
- Dashboard
- Model management pages
- Add / edit / delete data pages
So yes — many pages are automatically provided by Django.
What It Does Not Do
It does not create your public website pages like:
- Homepage
- About page
- Contact page
- Blog pages
- Product pages
Those must be created by you.
How Custom Routes Are Created
You write them using
path().Example:
from django.urls import path from . import views urlpatterns = [ path("", views.index, name="index"), path("about/", views.about, name="about"), path("contact/", views.contact, name="contact"), ]Now:
/= homepage/about/= about page/contact/= contact page
Can Admin Be Customized Too?
Yes.
Inside
admin.py, you can:- register models
- change columns shown
- add search boxes
- add filters
- customize forms
Example:
from django.contrib import admin from .models import Entry admin.site.register(Entry)Now that model appears inside admin panel.
Simple Analogy
Think of Django admin as a ready-built office complex.
Importing
admingives you the building.Your custom routes are the homes, shops, and parks you build elsewhere on the site.
Final Insight
Django gives you an instant admin backend.
But the public-facing website and custom experiences are created by your own routes, views, templates, and apps.
-
AuthorPosts
- You must be logged in to reply to this topic.
