Getting Started
🎸 Getting Started
Batteries-Included vs Minimal Core
You already know FastAPI's shape from the FastAPI Rebuild project — a handful of decorated functions and whatever libraries you chose to bring in yourself. Django starts from the opposite end:
FastAPI vs Django — Day One
FastAPI: Minimal Core
No ORM, no admin, no forms system, no templating — you choose and wire up each piece yourself (SQLAlchemy, Jinja2, Pydantic, ...).
Django: Batteries Included
Four commands and you already have an ORM, an admin interface, a templating engine, a forms system, and a migration tool — all part of the framework itself.
Convention Over Configuration
Like Rails' philosophy applied to Python — Django expects files in predictable places (models.py, views.py, urls.py) rather than asking you to decide the shape yourself.
The Trade-off
FastAPI is lighter and faster to learn end-to-end for a small API; Django's upfront structure pays off as an application grows past "a few endpoints."
📁 Project & App Structure
Django separates a project (the overall site configuration) from an app (a self-contained feature — blog, shop, accounts). One project can contain several apps:
Project vs App
A project is the whole site; an app is one reusable piece of it — a well-built app can even be dropped into a different Django project later.
manage.py
The command-line entry point for everything: runserver, migrate, startapp, shell, test — no separate CLI tool to install.
INSTALLED_APPS
A list in settings.py — an app's models, admin registration, and templates only take effect once it's added here.
settings.py
One file for database config, installed apps, middleware, templates, static files — versus assembling that configuration yourself across several files in FastAPI.
From Zero to a Running Server
The Four Commands That Start Every Django Project
That migrate step is worth noticing: even before you've written a single model of your own, Django already has database tables it needs for its built-in admin, auth, and session systems — another concrete example of "batteries included."
💻 Coding Challenges
Challenge 1: Create Your First Project and App
Install Django, run django-admin startproject to create a project called library, then create an app inside it called catalog with startapp. List the files startapp generates and describe what each one is for.
Goal: Get comfortable with the project/app distinction and the files Django scaffolds automatically.
Challenge 2: Register the App
After creating the catalog app, explain (and demonstrate with a code snippet) exactly what has to change in settings.py before Django will recognize it, and what visibly fails if you forget this step.
Goal: Practice the INSTALLED_APPS registration step that's easy to forget coming from FastAPI's import-and-go style.
Challenge 3: Explore manage.py
Run python manage.py help and pick three subcommands you haven't used yet. For each one, write one sentence describing what it does and when you'd reach for it.
Goal: Build familiarity with manage.py as the single entry point for nearly every Django task, instead of memorizing commands one at a time as they come up.
INSTALLED_APPSThe single most common "why isn't this working" moment for a Django newcomer: creating an app with startapp and writing models or views in it, then finding they're invisible to migrations, the admin, or template loading. Django only looks at apps listed in INSTALLED_APPS in settings.py — startapp creates the files, but it does not register them for you.
🎯 What's Next
With a project and an app running, the next chapter covers how a request actually finds its way to your code: URL Routing — urls.py, path() patterns, and how Django's URL dispatch compares to FastAPI's decorator-based routes.