Django Mastery Path¶
Django is the Python web framework that ships with the pieces most database-backed sites
end up needing: URL routing, an ORM with migrations, templates, forms, authentication,
an admin back office, sessions, caching and a long list of security defaults. That is
why a small team can get a real application online with it quickly. It is also why
Django projects go wrong in recognisable ways: a list page that quietly runs a hundred
queries, a cache that shows one user's data to another, a counter that loses updates
under load, a deploy that ships with DEBUG still on. This course teaches you to build
with Django and to understand the machinery well enough to avoid those mistakes.
Level 1 follows a single request through a project — settings, URLs and views,
templates and autoescaping, models and migrations, the ORM, the admin, forms and CSRF,
static files and uploads — and ends with a complete reading-list app. Level 2 is
what real applications need: relationships, Q/F/annotate/Subquery, finding and
fixing N+1 queries, class-based views, authentication, permissions, a custom user model,
sessions and middleware, and testing, ending with a multi-user task board. Level 3
builds APIs and handles concurrency: Django REST Framework serializers, viewsets and
permissions, signals, transactions and race conditions, zero-downtime migrations,
caching, Django 6's tasks framework alongside Celery, and async views, ending with a
token-authenticated REST API. Level 4 is production: security and the built-in CSP,
environment-driven settings, Gunicorn/Uvicorn deployment with PostgreSQL, EXPLAIN and
indexes, management commands, custom template tags and partials, logging and health
checks, time zones and translation, and upgrading Django, ending with a production-ready
book-club app.
Every lesson has a How It Actually Works section — why a QuerySet doesn't touch the
database until you iterate it, how select_related and prefetch_related produce
different SQL, why a post_save receiver doesn't fire for update(), what
select_for_update actually locks, why mutating request.session["cart"] in place
doesn't get saved.
Run, not imagined
Commands, queries, SQL and error messages in this course come from real runs on Django 6.1.1 (and Django REST Framework 3.18.1 for the API lessons) with Python 3.14, mostly on SQLite and on PostgreSQL where the behaviour differs. Each level page lists exactly what was run and what wasn't — for example, Celery and Redis examples are shown as configuration only, because those services weren't available. Timings are one laptop's results, not benchmarks.
How the program is organized¶
| Level | Focus | Modules |
|---|---|---|
| Level 1 · Entry | The request/response cycle, project setup, URLs and views, templates, models and migrations, the ORM, the admin, forms and CSRF, static files and uploads | 9 topics + 1 project (a reading-list app) |
| Level 2 · Intermediate | Relationships, advanced QuerySets, N+1 queries, class-based views, authentication, permissions, custom user model, sessions and middleware, testing | 9 topics + 1 project (a multi-user task board) |
| Level 3 · Advanced | DRF serializers, viewsets and permissions, signals, transactions and constraints, migrations in depth, caching, background tasks, async Django | 9 topics + 1 project (a REST API) |
| Level 4 · Master | Security, production settings, deployment, database performance, management commands, template tags and partials, logging, i18n and time zones, upgrading | 9 topics + 1 capstone (a production-ready book-club app) |
How to use this site¶
- Know your Python first. Django is plain Python classes and functions, and every error arrives as a traceback. If classes, decorators or virtual environments are unfamiliar, work through Python Mastery Path first.
- Build along in one project. Lessons reuse the same small book catalogue, so keep one project going and add to it rather than starting fresh each time.
- Watch the SQL. Turn on query logging or use
connection.queriesand look at what the ORM sends. Most performance lessons here start by counting queries. - Related courses. For SQL itself, see SQL Mastery Path; for API design beyond DRF, REST API Mastery Path; for testing in depth, Python Testing Mastery Path; for containers, Docker Mastery Path.
- Do the Exercise at the end of each lesson; the module-10 projects build on them.
Start here → Level 1 · Entry
🎥 Prefer video? Watch the Mastery Path video series on YouTube — Shorts and full walkthroughs of lessons across the series.
More from the Mastery Path series¶
Free, structured, module-wise training across 77 other languages, platforms and disciplines:
Languages
Web Frameworks
Testing & QA
Security
Cloud Platforms
Data & Analytics
AI / ML / LLM
Embedded Systems
Leadership & Management
Professional Skills
Careers & Interviews
Process & APIs
Infrastructure & Ops