Django Cheat Sheet

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

A single-page, colour-coded summary of the Django essentials, written against Django 6.1 (6.1.1), with Django 5.2 LTS (5.2.17) differences flagged by version, Python 3.12-3.14 and PostgreSQL 15 or newer (versions verified 2026-10-03) — the project layout and manage.py commands, settings including STORAGES, models and fields (choices, db_default, GeneratedField, constraints, indexes and composite primary keys), relationships and every on_delete option including the 6.1 database-level DB_* ones, Meta, model inheritance, managers and migrations, the ORM (lookups, F and Q, aggregation, Subquery and window functions, select_related, prefetch_related and the 6.1 fetch modes, transactions and on_commit), URLs and views (converters, namespaces, reverse, shortcuts, decorators and the generic class-based view map with its key hooks), a request/response-cycle strip with the default MIDDLEWARE order, templates (key tags and filters, partials, {% querystring %}, custom tags), forms (validation order, model forms, formsets, rendering), the admin, authentication and security settings (POST logout, LoginRequiredMiddleware, custom user model, hashers, CSRF, CSP, HSTS and check --deploy), services (cache, email and MAILERS, tasks, signals, logging, i18n and time zones, pagination), async and Channels, Django REST framework and Django Ninja, testing, deployment servers, and a strip of what changed since older tutorials — handy for quick memorization or as a downloadable PDF desk reference.

Download the Django Cheat Sheet (PDF)

For the full explanation, every option, and additional examples, see the dedicated pages:

Start here — Django.

Admin — Admin Site and Admin Customization.

Async and real-time — Async Support and Channels & WebSockets.