Skip to content
Pressentify
Home
Learn
Handbooks
32 print-ready volumes across 6 handbooks
7 volumes
System Design
2 volumes
AWS Production
4 volumes
Python
6 volumes
FastAPI
7 volumes
AI Full-Stack
6 volumes
Django
Topics
14 courses, beginner to production
Python
PostgreSQL
System Design
Django
MongoDB
AWS
AI Full-Stack
Data Structures & Algorithms
JavaScript
React
Docker
FastAPI
Next.js
MySQL
Cheatsheets
8 one-page quick references
Python
PostgreSQL
System Design
Django
MongoDB
AWS
AI Full-Stack
Data Structures & Algorithms
DSA Lab
12 animated lessons, synced to running code
Binary Search
Two Pointers
Maximum Subarray (Kadane’s)
Move Zeroes
Minimum Size Subarray Sum
Roadmap
Study planner
Job hunt
AI Interview
Blog
Sign in
Get started
Cheatsheets
/
Django
Django cheat sheets
67 sheets · 67 sections
Quick reference
Full course
01
Django Fundamentals
1 sheet
Core concepts
What Django is
MTV architecture
URL configuration
Views
Models
Settings
Templates
Forms
Middleware
Admin
Authentication
Sessions
02
Django Project Structure
1 sheet
Django Project Structure
manage.py
App models.py
App views.py
migrations/
settings.py
urls.py (project)
App apps.py
App admin.py
App tests.py
App urls.py
templates/
static/
04
Settings and Configuration
1 sheet
Core settings
Routing, rendering, and auth settings
Locale, static, and media settings
Cache, email, logging, and server settings
05
URL Routing
1 sheet
URL Routing
re_path() and regex patterns
URL namespaces
reverse() and reverse_lazy()
Versioned URLs and naming conventions
06
Function-Based Views
1 sheet
Function-Based Views
render(), redirect(), HttpResponse, JsonResponse
Reading data off the request
Handling HTTP methods in an FBV
Session and authentication context in a view
07
Class-Based Views
1 sheet
Class-Based Views
The View base class and dispatch()
TemplateView and ListView
DetailView, CreateView, UpdateView, DeleteView
FormView and the form-handling methods
Mixins, MRO, and when CBVs help vs confuse
08
Templates
1 sheet
Templates
Template inheritance
Autoescaping and safe strings
Custom tags, filters, and template loading
csrf_token, static, and url tags
09
Forms
1 sheet
Forms
ModelForm
Widgets, labels, initial values, and help text
Custom validation: validators, clean_<field>(), clean()
Errors, disabled/dynamic fields, and file uploads
Formsets and model formsets
10
Django Models
1 sheet
Django Models
Primary keys and field-level options
Model Meta: db_table, verbose_name, ordering
Meta.constraints and Meta.indexes
11
Django Field Types
1 sheet
Django Field Types
Text and numeric field types
Date and time field types
Specialized, validated, and file fields
14
Relationships
1 sheet
Relationships
ForeignKey, OneToOneField, and ManyToManyField
Reverse relations and through models
Self-referencing relationships
16
Model Methods and Properties
1 sheet
Model Methods and Properties
save() and delete()
clean() and full_clean()
Instance methods, @property, and where domain logic belongs
17
Django ORM Fundamentals
1 sheet
Django ORM Fundamentals
QuerySets: laziness, chaining, cloning, and caching
The retrieval methods
The write methods
18
Query Expressions
1 sheet
Query Expressions
F() and Q() expressions
Value(), Case/When, and ExpressionWrapper
Database functions: Cast, Coalesce, and the function families
19
Aggregation and Annotation
1 sheet
Aggregation and Annotation
annotate() vs aggregate()
Conditional aggregation and distinct=True
Grouping with values() + annotate()
20
Advanced ORM Queries
1 sheet
Advanced ORM Queries
Subquery, OuterRef, and Exists
Window functions
Raw SQL: .raw(), RawSQL, and legacy extra()
27
PostgreSQL with Django
1 sheet
PostgreSQL with Django
Index types
Transactions and isolation levels
Locks and deadlocks
Query plans: EXPLAIN and EXPLAIN ANALYZE
VACUUM and ANALYZE
Connection limits, replicas, and partitioning
29
Transactions
1 sheet
Transactions
transaction.atomic() and nested blocks
The broken-transaction trap, and retrying on conflict
on_commit(), durable=True, and ATOMIC_REQUESTS
32
Migrations
1 sheet
Migrations
makemigrations, migrate, and the dependency graph
Forward and reverse migrations
RunPython/RunSQL, fake migrations, and squashing
36
Django Admin
1 sheet
Django Admin
ModelAdmin basics
Inlines, custom actions, and permissions
Admin performance and query optimization
37
Authentication
1 sheet
Authentication
The User model, and swapping it for a custom one
Login, logout, and authentication backends
Password hashing/validation/reset, and staff/superuser/groups/permissions
40
Middleware
1 sheet
Middleware
The request/response lifecycle, ordering, and short-circuiting
Writing custom middleware, exception handling, and async support
The built-in middleware stack, and why its default order matters
44
Media Files and Uploads
1 sheet
Media Files and Uploads
MEDIA_ROOT, MEDIA_URL, FileField/ImageField, and upload handlers
Size, MIME, filename, and image validation — every upload is untrusted input
Object storage, S3, pre-signed URLs, streaming, and lifecycle
45
Django REST Framework — Must Be Strong for API Roles
1 sheet
Django REST Framework — Must Be Strong for API Roles
DRF architecture, Serializers, ModelSerializer, and fields
validate_<field>(), validate(), create(), and update()
Nested serializers, read/write-only fields, context, and dynamic shapes
46
DRF Views
1 sheet
DRF Views
APIView, generic views, and mixins
ViewSet, GenericViewSet, ModelViewSet, routers, and @action
get_queryset(), get_serializer_class/context(), and perform_*()
47
DRF Authentication
1 sheet
DRF Authentication
SessionAuthentication, TokenAuthentication, and JWT
Authentication order, anonymous users, and 401 vs 403
OAuth2 concepts, custom authentication classes, and the integrations
48
DRF Permissions
1 sheet
DRF Permissions
AllowAny, IsAuthenticated, IsAdminUser, and the shipped set
Custom BasePermission, object-level checks, and ownership
Role-based permissions, composition, and why validation is not authorization
49
DRF Filtering, Search, and Ordering
1 sheet
DRF Filtering, Search, and Ordering
Query parameters, django-filter, and FilterSet
SearchFilter, OrderingFilter, and custom backends
Query validation, complexity controls, and expensive filters
50
DRF Pagination
1 sheet
DRF Pagination
PageNumberPagination, LimitOffsetPagination, and the metadata
Cursor pagination, stable ordering, and large datasets
Custom pagination classes and page-size limits
51
DRF Throttling and Rate Limiting
1 sheet
DRF Throttling and Rate Limiting
Anonymous, user, and scoped throttling
Custom throttles, Redis, and the multi-instance problem
Abuse prevention and quotas
52
API Design
1 sheet
API Design
REST principles and resource-oriented URLs
HTTP semantics, status codes, and method idempotency
Request validation, response schemas, and error contracts
Collection controls: pagination, filtering, sorting, search
Versioning, backward compatibility, and deprecation
54
API Error Handling
1 sheet
API Error Handling
Validation errors and the 4xx status codes
500, and the 502 / 503 / 504 family
Global exception handlers, stable payloads, and correlation IDs
Safe error messages, and what must never leave the server
55
OpenAPI and API Documentation
1 sheet
OpenAPI and API Documentation
OpenAPI, schema generation, and request/response schemas
Swagger UI, ReDoc, documenting auth, examples, and versioning
drf-spectacular, and drf-yasg in legacy codebases
56
Django Security
1 sheet
Django Security
CSRF, XSS, SQL injection, and clickjacking
Host validation, HTTPS, HSTS, and the cookie flags
Passwords, sessions, SSRF, open redirects, and uploads
Dependencies, secrets, and check --deploy
58
Caching
1 sheet
Caching
Per-site, per-view, template fragment, and the low-level API
Redis, Memcached, cache keys, and TTL
Invalidation, warming, stampede, penetration, and consistency
59
Redis for Django
1 sheet
Redis for Django
Strings, hashes, lists, sets, and sorted sets
TTL and expiration, atomic commands, Pub/Sub, and Streams
Cache, rate limiter, broker, lock — and what breaks when Redis is down
60
Async Django
1 sheet
Async Django
async def views, await, async middleware, and the ASGI requirement
The async ORM, sync_to_async, async_to_sync, and database access
Async HTTP clients, cancellation, timeouts, and concurrency limits
63
Celery
1 sheet
Celery
The Celery app, tasks, workers, and task discovery
Brokers and result backends
Retries, backoff, autoretry_for, ETA/countdown, and Beat
Queues, routing, worker concurrency, and time limits
Task idempotency, monitoring, recovery, and Flower
66
Django Testing
1 sheet
Django Testing
SimpleTestCase, TestCase, and TransactionTestCase
The test client, and testing requests, URLs, templates, models and forms
pytest, pytest-django, fixtures, scopes, and database access
Parameterization, marks, async tests, and factories
67
Mocking
1 sheet
Mocking
Mock, MagicMock, patch, AsyncMock, and monkeypatching
Stubs, fakes, spies, and the test-double vocabulary
What to mock, what not to, and behaviour over implementation
68
Django API Testing
1 sheet
Django API Testing
Testing authentication, authorization, and permission failures
Testing validation, error schemas, status codes, and collections
Testing idempotency, rate limits, side effects, and integrations
69
Database Testing
1 sheet
Database Testing
The test database lifecycle, and transaction behaviour per test class
Testing constraints, unique violations, and real races
Query-count assertions, factories, and migration tests
70
Contract and Integration Testing
1 sheet
Contract and Integration Testing
Contract tests, integration tests, and the four test doubles
Testing retry behaviour, timeouts, and idempotency
Webhook testing, and the five integration surfaces
71
Performance Fundamentals
1 sheet
Performance Fundamentals
Big-O where it counts: round trips, not instructions
The four bottlenecks, and how to tell which one you have
Query cost, serialization cost, and cache behaviour
72
Django Performance Debugging
1 sheet
Django Performance Debugging
Locating the time in a slow request
N+1 queries, connection exhaustion, and lock contention
High memory, huge payloads, and excessive serialization
Slow dependencies, and the right tool for each symptom
73
Pagination and Large Result Sets
1 sheet
Pagination and Large Result Sets
Page numbers, limit/offset, and cursors — and stable ordering
`iterator()`, batch processing, and streaming responses
Large export jobs
74
Large Data Operations
1 sheet
Large Data Operations
`bulk_create()`, `bulk_update()`, and what they skip
Database-side updates, and deleting in batches
Data migrations, background workers, and resumable work
75
Database Connection Management
1 sheet
Database Connection Management
The connection lifecycle, and `CONN_MAX_AGE`
Worker multiplication and connection exhaustion
Pooling, PgBouncer, and long-running transactions
77
Observability
1 sheet
Observability
Logs, metrics, and traces — three questions, not three formats
Request ids, correlation ids, and error tracking
The signals worth measuring
Alerts, dashboards, and the ecosystem
78
Structured Logging
1 sheet
Structured Logging
Loggers, handlers, formatters, filters — and levels
JSON logs, and the context fields worth carrying
Keeping secrets out of logs
80
Email Systems
1 sheet
Email Systems
The email API, and the backend underneath it
Delivery belongs in the background
Bounces, and what "sent" actually means
81
Internationalization and Time Zones
1 sheet
Internationalization and Time Zones
The settings that turn it on, and what each one actually controls
`gettext` vs `gettext_lazy`, and the file workflow behind them
Naive vs aware, UTC, and the hour that happens twice
82
Management Commands
1 sheet
Management Commands
`BaseCommand`, and the two methods that make one
Output, errors and the exit code something else is reading
Dry-run, batching, and being safe to run twice
The six jobs, and what each one needs to be safe
83
File Exports and Imports
1 sheet
File Exports and Imports
Formats, and streaming instead of building in memory
When streaming is not enough: async exports and signed URLs
Imports: validation, partial failure, and being safe to re-upload
84
Multi-Tenancy
1 sheet
Multi-Tenancy
Identifying the tenant, and the three isolation models
Making the tenant filter impossible to forget
Per-tenant limits, configuration and audit
85
Auditing
1 sheet
Auditing
Timestamps and actors — the cheapest auditing there is
Three kinds of record, and why they are not interchangeable
What actually needs auditing — and what data access logging costs
86
Soft Delete
1 sheet
Soft Delete
The field, and the manager that hides it
What soft delete breaks, and how to repair each one
Restore, hard delete, and whether to do this at all
87
State Machines and Workflows
1 sheet
State Machines and Workflows
Valid transitions — and making the invalid ones impossible
Two workers, one order: locking and the transaction boundary
Idempotency, events, and the history the transition leaves behind
88
Payment and Webhook Workflows
1 sheet
Payment and Webhook Workflows
The payment state model, and who is allowed to say "paid"
Verifying a webhook, and why the raw body matters
Duplicates, out-of-order events, and where the transaction goes
Reconciliation, retries, and the audit trail money requires
89
Event-Driven Architecture
1 sheet
Event-Driven Architecture
Producers, consumers — and why a topic is not a queue
Ordering, at-least-once delivery, and consumers that can be run twice
Eventual consistency, the outbox, and versioning an event
90
Reliability Patterns
1 sheet
Reliability Patterns
Timeouts, retries, backoff and jitter
Circuit breakers, bulkheads and rate limits
Degrade, fall back, dead-letter, health-check
91
Linux for Django Developers
1 sheet
Linux for Django Developers
Processes, PIDs, signals and threads
Users, groups, permissions and the environment
Looking at a running box: ps, top, htop, lsof, kill
grep, awk, sed — and curl, ssh, scp
systemctl, journalctl and cron
92
Networking
1 sheet
Networking
Addresses, ports, sockets and the transport underneath
HTTP, HTTPS and where TLS actually ends
Reverse proxies, load balancers, pooling and timeouts
WebSockets and Server-Sent Events
94
Gunicorn, Uvicorn, and Deployment Workers
1 sheet
Gunicorn, Uvicorn, and Deployment Workers
Gunicorn, Uvicorn, and choosing a worker class
How many workers, how many threads
Timeouts, max requests, and restarting without dropping anything
95
CI/CD
1 sheet
CI/CD
The pipeline, and the gates in the right order
Secrets in the pipeline, and scanning what you depend on
Build once, promote, approve — and be able to go back
96
Deployment Strategies
1 sheet
Deployment Strategies
Rolling, blue/green and canary
Feature flags: deploying is not releasing
Draining, health checks and the smoke test that decides
Rollback planning, and why migrations make it hard
99
Architecture Styles
1 sheet
Architecture Styles
Monolith, modular monolith, microservices
Layered, clean and hexagonal
Domain-driven design and event-driven, as styles
01
Django Fundamentals
1 sheet
Core concepts
What Django is
MTV architecture
URL configuration
Views
Models
Settings
Templates
Forms
Middleware
Admin
Authentication
Sessions
06
Function-Based Views
1 sheet
Function-Based Views
render(), redirect(), HttpResponse, JsonResponse
Reading data off the request
Handling HTTP methods in an FBV
Session and authentication context in a view
09
Forms
1 sheet
Forms
ModelForm
Widgets, labels, initial values, and help text
Custom validation: validators, clean_<field>(), clean()
Errors, disabled/dynamic fields, and file uploads
Formsets and model formsets
17
Django ORM Fundamentals
1 sheet
Django ORM Fundamentals
QuerySets: laziness, chaining, cloning, and caching
The retrieval methods
The write methods
20
Advanced ORM Queries
1 sheet
Advanced ORM Queries
Subquery, OuterRef, and Exists
Window functions
Raw SQL: .raw(), RawSQL, and legacy extra()
32
Migrations
1 sheet
Migrations
makemigrations, migrate, and the dependency graph
Forward and reverse migrations
RunPython/RunSQL, fake migrations, and squashing
37
Authentication
1 sheet
Authentication
The User model, and swapping it for a custom one
Login, logout, and authentication backends
Password hashing/validation/reset, and staff/superuser/groups/permissions
45
Django REST Framework — Must Be Strong for API Roles
1 sheet
Django REST Framework — Must Be Strong for API Roles
DRF architecture, Serializers, ModelSerializer, and fields
validate_<field>(), validate(), create(), and update()
Nested serializers, read/write-only fields, context, and dynamic shapes
48
DRF Permissions
1 sheet
DRF Permissions
AllowAny, IsAuthenticated, IsAdminUser, and the shipped set
Custom BasePermission, object-level checks, and ownership
Role-based permissions, composition, and why validation is not authorization
51
DRF Throttling and Rate Limiting
1 sheet
DRF Throttling and Rate Limiting
Anonymous, user, and scoped throttling
Custom throttles, Redis, and the multi-instance problem
Abuse prevention and quotas
55
OpenAPI and API Documentation
1 sheet
OpenAPI and API Documentation
OpenAPI, schema generation, and request/response schemas
Swagger UI, ReDoc, documenting auth, examples, and versioning
drf-spectacular, and drf-yasg in legacy codebases
58
Caching
1 sheet
Caching
Per-site, per-view, template fragment, and the low-level API
Redis, Memcached, cache keys, and TTL
Invalidation, warming, stampede, penetration, and consistency
63
Celery
1 sheet
Celery
The Celery app, tasks, workers, and task discovery
Brokers and result backends
Retries, backoff, autoretry_for, ETA/countdown, and Beat
Queues, routing, worker concurrency, and time limits
Task idempotency, monitoring, recovery, and Flower
69
Database Testing
1 sheet
Database Testing
The test database lifecycle, and transaction behaviour per test class
Testing constraints, unique violations, and real races
Query-count assertions, factories, and migration tests
72
Django Performance Debugging
1 sheet
Django Performance Debugging
Locating the time in a slow request
N+1 queries, connection exhaustion, and lock contention
High memory, huge payloads, and excessive serialization
Slow dependencies, and the right tool for each symptom
75
Database Connection Management
1 sheet
Database Connection Management
The connection lifecycle, and `CONN_MAX_AGE`
Worker multiplication and connection exhaustion
Pooling, PgBouncer, and long-running transactions
80
Email Systems
1 sheet
Email Systems
The email API, and the backend underneath it
Delivery belongs in the background
Bounces, and what "sent" actually means
83
File Exports and Imports
1 sheet
File Exports and Imports
Formats, and streaming instead of building in memory
When streaming is not enough: async exports and signed URLs
Imports: validation, partial failure, and being safe to re-upload
86
Soft Delete
1 sheet
Soft Delete
The field, and the manager that hides it
What soft delete breaks, and how to repair each one
Restore, hard delete, and whether to do this at all
89
Event-Driven Architecture
1 sheet
Event-Driven Architecture
Producers, consumers — and why a topic is not a queue
Ordering, at-least-once delivery, and consumers that can be run twice
Eventual consistency, the outbox, and versioning an event
91
Linux for Django Developers
1 sheet
Linux for Django Developers
Processes, PIDs, signals and threads
Users, groups, permissions and the environment
Looking at a running box: ps, top, htop, lsof, kill
grep, awk, sed — and curl, ssh, scp
systemctl, journalctl and cron
96
Deployment Strategies
1 sheet
Deployment Strategies
Rolling, blue/green and canary
Feature flags: deploying is not releasing
Draining, health checks and the smoke test that decides
Rollback planning, and why migrations make it hard
02
Django Project Structure
1 sheet
Django Project Structure
manage.py
App models.py
App views.py
migrations/
settings.py
urls.py (project)
App apps.py
App admin.py
App tests.py
App urls.py
templates/
static/
07
Class-Based Views
1 sheet
Class-Based Views
The View base class and dispatch()
TemplateView and ListView
DetailView, CreateView, UpdateView, DeleteView
FormView and the form-handling methods
Mixins, MRO, and when CBVs help vs confuse
11
Django Field Types
1 sheet
Django Field Types
Text and numeric field types
Date and time field types
Specialized, validated, and file fields
16
Model Methods and Properties
1 sheet
Model Methods and Properties
save() and delete()
clean() and full_clean()
Instance methods, @property, and where domain logic belongs
19
Aggregation and Annotation
1 sheet
Aggregation and Annotation
annotate() vs aggregate()
Conditional aggregation and distinct=True
Grouping with values() + annotate()
29
Transactions
1 sheet
Transactions
transaction.atomic() and nested blocks
The broken-transaction trap, and retrying on conflict
on_commit(), durable=True, and ATOMIC_REQUESTS
36
Django Admin
1 sheet
Django Admin
ModelAdmin basics
Inlines, custom actions, and permissions
Admin performance and query optimization
44
Media Files and Uploads
1 sheet
Media Files and Uploads
MEDIA_ROOT, MEDIA_URL, FileField/ImageField, and upload handlers
Size, MIME, filename, and image validation — every upload is untrusted input
Object storage, S3, pre-signed URLs, streaming, and lifecycle
47
DRF Authentication
1 sheet
DRF Authentication
SessionAuthentication, TokenAuthentication, and JWT
Authentication order, anonymous users, and 401 vs 403
OAuth2 concepts, custom authentication classes, and the integrations
50
DRF Pagination
1 sheet
DRF Pagination
PageNumberPagination, LimitOffsetPagination, and the metadata
Cursor pagination, stable ordering, and large datasets
Custom pagination classes and page-size limits
54
API Error Handling
1 sheet
API Error Handling
Validation errors and the 4xx status codes
500, and the 502 / 503 / 504 family
Global exception handlers, stable payloads, and correlation IDs
Safe error messages, and what must never leave the server
59
Redis for Django
1 sheet
Redis for Django
Strings, hashes, lists, sets, and sorted sets
TTL and expiration, atomic commands, Pub/Sub, and Streams
Cache, rate limiter, broker, lock — and what breaks when Redis is down
66
Django Testing
1 sheet
Django Testing
SimpleTestCase, TestCase, and TransactionTestCase
The test client, and testing requests, URLs, templates, models and forms
pytest, pytest-django, fixtures, scopes, and database access
Parameterization, marks, async tests, and factories
68
Django API Testing
1 sheet
Django API Testing
Testing authentication, authorization, and permission failures
Testing validation, error schemas, status codes, and collections
Testing idempotency, rate limits, side effects, and integrations
71
Performance Fundamentals
1 sheet
Performance Fundamentals
Big-O where it counts: round trips, not instructions
The four bottlenecks, and how to tell which one you have
Query cost, serialization cost, and cache behaviour
74
Large Data Operations
1 sheet
Large Data Operations
`bulk_create()`, `bulk_update()`, and what they skip
Database-side updates, and deleting in batches
Data migrations, background workers, and resumable work
78
Structured Logging
1 sheet
Structured Logging
Loggers, handlers, formatters, filters — and levels
JSON logs, and the context fields worth carrying
Keeping secrets out of logs
82
Management Commands
1 sheet
Management Commands
`BaseCommand`, and the two methods that make one
Output, errors and the exit code something else is reading
Dry-run, batching, and being safe to run twice
The six jobs, and what each one needs to be safe
85
Auditing
1 sheet
Auditing
Timestamps and actors — the cheapest auditing there is
Three kinds of record, and why they are not interchangeable
What actually needs auditing — and what data access logging costs
88
Payment and Webhook Workflows
1 sheet
Payment and Webhook Workflows
The payment state model, and who is allowed to say "paid"
Verifying a webhook, and why the raw body matters
Duplicates, out-of-order events, and where the transaction goes
Reconciliation, retries, and the audit trail money requires
92
Networking
1 sheet
Networking
Addresses, ports, sockets and the transport underneath
HTTP, HTTPS and where TLS actually ends
Reverse proxies, load balancers, pooling and timeouts
WebSockets and Server-Sent Events
95
CI/CD
1 sheet
CI/CD
The pipeline, and the gates in the right order
Secrets in the pipeline, and scanning what you depend on
Build once, promote, approve — and be able to go back
04
Settings and Configuration
1 sheet
Core settings
Routing, rendering, and auth settings
Locale, static, and media settings
Cache, email, logging, and server settings
05
URL Routing
1 sheet
URL Routing
re_path() and regex patterns
URL namespaces
reverse() and reverse_lazy()
Versioned URLs and naming conventions
08
Templates
1 sheet
Templates
Template inheritance
Autoescaping and safe strings
Custom tags, filters, and template loading
csrf_token, static, and url tags
10
Django Models
1 sheet
Django Models
Primary keys and field-level options
Model Meta: db_table, verbose_name, ordering
Meta.constraints and Meta.indexes
14
Relationships
1 sheet
Relationships
ForeignKey, OneToOneField, and ManyToManyField
Reverse relations and through models
Self-referencing relationships
18
Query Expressions
1 sheet
Query Expressions
F() and Q() expressions
Value(), Case/When, and ExpressionWrapper
Database functions: Cast, Coalesce, and the function families
27
PostgreSQL with Django
1 sheet
PostgreSQL with Django
Index types
Transactions and isolation levels
Locks and deadlocks
Query plans: EXPLAIN and EXPLAIN ANALYZE
VACUUM and ANALYZE
Connection limits, replicas, and partitioning
40
Middleware
1 sheet
Middleware
The request/response lifecycle, ordering, and short-circuiting
Writing custom middleware, exception handling, and async support
The built-in middleware stack, and why its default order matters
46
DRF Views
1 sheet
DRF Views
APIView, generic views, and mixins
ViewSet, GenericViewSet, ModelViewSet, routers, and @action
get_queryset(), get_serializer_class/context(), and perform_*()
49
DRF Filtering, Search, and Ordering
1 sheet
DRF Filtering, Search, and Ordering
Query parameters, django-filter, and FilterSet
SearchFilter, OrderingFilter, and custom backends
Query validation, complexity controls, and expensive filters
52
API Design
1 sheet
API Design
REST principles and resource-oriented URLs
HTTP semantics, status codes, and method idempotency
Request validation, response schemas, and error contracts
Collection controls: pagination, filtering, sorting, search
Versioning, backward compatibility, and deprecation
56
Django Security
1 sheet
Django Security
CSRF, XSS, SQL injection, and clickjacking
Host validation, HTTPS, HSTS, and the cookie flags
Passwords, sessions, SSRF, open redirects, and uploads
Dependencies, secrets, and check --deploy
60
Async Django
1 sheet
Async Django
async def views, await, async middleware, and the ASGI requirement
The async ORM, sync_to_async, async_to_sync, and database access
Async HTTP clients, cancellation, timeouts, and concurrency limits
67
Mocking
1 sheet
Mocking
Mock, MagicMock, patch, AsyncMock, and monkeypatching
Stubs, fakes, spies, and the test-double vocabulary
What to mock, what not to, and behaviour over implementation
70
Contract and Integration Testing
1 sheet
Contract and Integration Testing
Contract tests, integration tests, and the four test doubles
Testing retry behaviour, timeouts, and idempotency
Webhook testing, and the five integration surfaces
73
Pagination and Large Result Sets
1 sheet
Pagination and Large Result Sets
Page numbers, limit/offset, and cursors — and stable ordering
`iterator()`, batch processing, and streaming responses
Large export jobs
77
Observability
1 sheet
Observability
Logs, metrics, and traces — three questions, not three formats
Request ids, correlation ids, and error tracking
The signals worth measuring
Alerts, dashboards, and the ecosystem
81
Internationalization and Time Zones
1 sheet
Internationalization and Time Zones
The settings that turn it on, and what each one actually controls
`gettext` vs `gettext_lazy`, and the file workflow behind them
Naive vs aware, UTC, and the hour that happens twice
84
Multi-Tenancy
1 sheet
Multi-Tenancy
Identifying the tenant, and the three isolation models
Making the tenant filter impossible to forget
Per-tenant limits, configuration and audit
87
State Machines and Workflows
1 sheet
State Machines and Workflows
Valid transitions — and making the invalid ones impossible
Two workers, one order: locking and the transaction boundary
Idempotency, events, and the history the transition leaves behind
90
Reliability Patterns
1 sheet
Reliability Patterns
Timeouts, retries, backoff and jitter
Circuit breakers, bulkheads and rate limits
Degrade, fall back, dead-letter, health-check
94
Gunicorn, Uvicorn, and Deployment Workers
1 sheet
Gunicorn, Uvicorn, and Deployment Workers
Gunicorn, Uvicorn, and choosing a worker class
How many workers, how many threads
Timeouts, max requests, and restarting without dropping anything
99
Architecture Styles
1 sheet
Architecture Styles
Monolith, modular monolith, microservices
Layered, clean and hexagonal
Domain-driven design and event-driven, as styles