#Django

28 posts

Django DRF #6: Testing and Deployment — Docker, gunicorn, nginx
13 min read

Django DRF #6: Testing and Deployment — Docker, gunicorn, nginx

Integration tests with APITestCase / APIClient / pytest-django / factory_boy, plus production deployment via Docker multi-stage + gunicorn + nginx + docker-compose.

Django DRF #5: OpenAPI Docs — drf-spectacular
9 min read

Django DRF #5: OpenAPI Docs — drf-spectacular

Auto-generate the OpenAPI 3.x schema / Swagger UI / ReDoc for a DRF API with drf-spectacular, and precisely specify responses, errors, and auth via decorators.

Django DRF #4: Async Work with Celery
10 min read

Django DRF #4: Async Work with Celery

The standard for separating heavy work / external IO / scheduling from the response flow — Celery + Redis setup, signal integration, retry, periodic tasks, and monitoring.

Django DRF #3: Filtering / Ordering / Pagination
8 min read

Django DRF #3: Filtering / Ordering / Pagination

Search filters with django-filter, OrderingFilter/SearchFilter, and a comparison of where PageNumber/LimitOffset/Cursor pagination fit best.

Django DRF #2: Authentication/Permissions — Token, JWT, custom permission
8 min read

Django DRF #2: Authentication/Permissions — Token, JWT, custom permission

DRF authentication backends (Session/Token/JWT), permission classes, and object-level custom permissions like IsOwner — all in one place.

Django DRF #1: Getting Started — Serializer, ViewSet, Router
10 min read

Django DRF #1: Getting Started — Serializer, ViewSet, Router

The standard for laying a REST API on top of Django — DRF Serializer/ViewSet/Router fundamentals in one place.

Django Advanced #7: Deployment security — settings split, ALLOWED_HOSTS, CSRF, secret management
12 min read

Django Advanced #7: Deployment security — settings split, ALLOWED_HOSTS, CSRF, secret management

Settings split patterns, django-environ, DEBUG/ALLOWED_HOSTS/CSRF/HSTS, SECRET_KEY management, and manage.py check --deploy — what to verify before putting Django into production.

Django Advanced #6: Django Channels — WebSocket
8 min read

Django Advanced #6: Django Channels — WebSocket

Channels setup, AsyncWebsocketConsumer, broadcast via channel_layer, push from HTTP views, daphne/uvicorn deployment, nginx WebSocket proxy.

Django Advanced #5: Signals in depth and post-transaction work
8 min read

Django Advanced #5: Signals in depth and post-transaction work

transaction.on_commit, savepoints, custom signals, mute_signals, Celery integration — every tool you need to use signals safely.

Django Advanced #4: Caching — per-view / template fragment / low-level
9 min read

Django Advanced #4: Caching — per-view / template fragment / low-level

From Redis backend setup to cache_page, template fragments, low-level cache.set/get, ETag, and stampede — every layer of Django caching.

Django Advanced #3: Query optimization — N+1, select_related, EXPLAIN, indexes
9 min read

Django Advanced #3: Query optimization — N+1, select_related, EXPLAIN, indexes

From the anatomy of N+1 to select_related/prefetch_related, only/defer, EXPLAIN, indexes, bulk_*, and select_for_update — the performance toolbox of Django ORM.

Django Advanced #2: Custom management commands
8 min read

Django Advanced #2: Custom management commands

From what manage.py actually is, to BaseCommand subclassing, argument parsing, cron integration, call_command, and testing — the full picture of custom commands as one axis of Django operations.