Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Web development

Django

Build database-backed web apps with Django 6.1: requests and URLs, the ORM, forms, auth, the admin, APIs, async work, testing, security and deployment.

35 lessons to read 10 modules

35 lessons: 30 free with Pro answers and 5 with a free core.

Examples run with Python 3.14.8 and Django 6.1.2.

Who it is for

Python developers building database-backed web apps. Assumes the Python track's basics (functions, classes, exceptions, virtual environments) and basic HTML; SQL knowledge helps from the ORM-in-depth module onwards.

What you will be able to do

  • Trace a request through Django's handler, middleware, URLconf and views, and set up a project the way teams do
  • Route URLs to views, render templates with partials, and serve static files
  • Model data with the ORM, write and read migrations, and query relationships without N+1 queries
  • Keep data correct under concurrency with transactions, constraints and PostgreSQL features
  • Validate input with forms and ModelForms, and accept file uploads safely
  • Authenticate users, design a custom user model, and enforce permissions down to single objects
  • Customise and harden the Django admin, and build pages with class-based views
  • Build REST and typed APIs with Django REST framework and Django Ninja, and interactive pages with htmx
  • Test, secure, cache, deploy and upgrade Django apps, from the system checks to production servers

Before this track

Revise and practise

Modules and lessons

What the labels mean

Free lesson, Pro answers
the whole lesson is free; the model answers to its interview questions open with a pass
Free core, Pro depth
the core of the lesson is free; its in-depth parts open with a pass
Pro
opens with a Pro, Premium or Ultimate pass

Minutes are reading time: “6 of 15 min free” means 6 minutes of the lesson are free.

What a pass opens in this track

13 in-depth parts and 75 interview answers. The same pass opens every other track and every Pro tool.

  1. Module 1

    Django foundations

    What Django is for, how a request flows through it, which version to use, and a first project set up the way professional teams do it.

    1. How Django handles a request Beginner Free lesson, Pro answers: 20 minutes
    2. Set up a Django 6.1 project Beginner Free lesson, Pro answers: 20 minutes
  2. Module 2

    URLs, views, templates and static files

    Routing with path() and converters, writing views that return the right responses, the template language, template partials and static files.

    1. URL routing with path() and converters Beginner Free lesson, Pro answers: 20 minutes
    2. Views, requests and responses Beginner Free lesson, Pro answers: 15 minutes
    3. Templates: variables, tags, filters and inheritance Beginner Free lesson, Pro answers: 20 minutes
    4. Template partials and custom template tags Intermediate Free lesson, Pro answers: 15 minutes
    5. Static files in development and production Beginner Free lesson, Pro answers: 15 minutes
  3. Module 3

    Models and the ORM

    Designing models, creating and reading migrations, querying with QuerySets and modelling relationships, including the database-level on_delete options added in 6.1.

    1. Django models: fields, null, blank and choices Beginner Free lesson, Pro answers: 30 minutes
    2. Migrations: makemigrations, migrate and sqlmigrate Beginner Free lesson, Pro answers: 20 minutes
    3. Django QuerySets: create, read, update, delete Beginner Free lesson, Pro answers: 20 minutes
    4. Relationships: ForeignKey, ManyToMany and OneToOne Intermediate Free lesson, Pro answers: 25 minutes
  4. Module 4

    The ORM in depth: performance, integrity and PostgreSQL

    Aggregation and expressions, N+1 queries and 6.1 fetch modes, transactions under concurrency, constraints and composite keys, raw SQL, PostgreSQL features and zero-downtime migrations.

    1. Aggregation, annotations and expressions Intermediate Free lesson, Pro answers: 25 minutes
    2. N+1 queries, prefetching and 6.1 fetch modes Intermediate Free lesson, Pro answers: 20 minutes
    3. Transactions, locking and race conditions Advanced Free lesson, Pro answers: 25 minutes
    4. Constraints, indexes and composite primary keys Intermediate Free lesson, Pro answers: 20 minutes
    5. Custom managers, raw SQL and EXPLAIN Intermediate Free lesson, Pro answers: 25 minutes
    6. PostgreSQL features in Django Advanced Free lesson, Pro answers: 20 minutes
    7. Data migrations and zero-downtime schema changes Advanced Free lesson, Pro answers: 20 minutes
  5. Module 5

    Forms, validation and file uploads

    Forms and the request cycle, validation in the right layer, ModelForms and formsets without mass assignment, and file uploads that don't trust the client.

    1. Forms: fields, widgets and the request cycle Beginner Free lesson, Pro answers: 20 minutes
    2. Validation: validators, clean() and model rules Intermediate Free lesson, Pro answers: 15 minutes
    3. ModelForms, formsets and inline formsets Intermediate Free lesson, Pro answers: 20 minutes
    4. File uploads and storage, done safely Intermediate Free lesson, Pro answers: 15 minutes
  6. Module 6

    Authentication and authorization

    Login, logout and password reset, a custom user model with phone or email login, permissions and object-level access, and account security from hashing to MFA.

    1. Login, logout and password reset Beginner Free lesson, Pro answers: 20 minutes
    2. A custom user model from day one Intermediate Free lesson, Pro answers: 15 minutes
    3. Permissions, groups and object-level access Intermediate Free lesson, Pro answers: 15 minutes
    4. Password hashing, lockouts, MFA and social login Intermediate Free lesson, Pro answers: 20 minutes
  7. Module 8

    Class-based views

    How class-based views and mixins work, and the generic views and pagination that cover most CRUD pages.

    1. Class-based views and mixins Intermediate Free lesson, Pro answers: 15 minutes
    2. Generic views and pagination Intermediate Free core, Pro depth: 6 of 15 minutes free
  8. Module 11

    APIs and modern front ends

    REST APIs with Django REST framework, API authentication, webhooks and OpenAPI, typed APIs with Django Ninja, and interactive server-rendered pages with htmx.

    1. REST APIs with Django REST framework Intermediate Free lesson, Pro answers: 15 minutes
    2. API auth, permissions, webhooks and OpenAPI Advanced Free core, Pro depth: 7 of 20 minutes free
    3. Typed APIs with Django Ninja Intermediate Free core, Pro depth: 7 of 20 minutes free
  9. Module 12

    Testing Django applications

    Django's test framework, pytest-django with factories and coverage, browser tests with Playwright, and CI gates that catch missing migrations and unsafe settings.

    1. Testing with Django's test framework Beginner Free lesson, Pro answers: 20 minutes
    2. pytest-django, factories and coverage Intermediate Free core, Pro depth: 7 of 20 minutes free
  10. Module 14

    Performance and caching

    Caching views, fragments and computations with Redis or the database, HTTP caching, and finding and fixing slow pages with measurements.

    1. Caching: per-view, fragments, low-level and HTTP Intermediate Free lesson, Pro answers: 15 minutes
    2. Django performance: profiling and optimising Advanced Free core, Pro depth: 6 of 20 minutes free

Related tools

Official documentation

More in Web development

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.