1.1 Django Project Setup & Architecture
django-admin startproject, startapp. Project structure: settings.py, urls.py, wsgi/asgi.py. Apps as modules: models.py, views.py, serializers.py, urls.py. Virtual environments (venv/pipenv/poetry). requirements.txt and pyproject.toml. Django 5.x new features: simplified form rendering, async view improvements.
1.2 Models & Django ORM
Model definition: CharField, IntegerField, DateTimeField, ForeignKey, ManyToManyField. Relationships: one-to-many (ForeignKey), many-to-many, one-to-one. Meta class: ordering, unique_together, verbose_name. Custom model managers. QuerySet API: filter(), exclude(), annotate(), aggregate(), select_related(), prefetch_related(). The N+1 problem and how select_related/prefetch_related fixes it.
1.3 Database Migrations
makemigrations → migrate workflow. Migration files: what they contain, why they're version-controlled. Data migrations (RunPython). Squashing migrations. Rolling back migrations. Why migrations matter: schema changes are versioned, repeatable, team-safe. Conflicts and how to resolve them. Django's migration system vs Flyway/Alembic — Django's is built-in and excellent.
1.4 Django REST Framework: Serializers & ViewSets
DRF installation and setup. Serializers: ModelSerializer, nested serializers, validation (validate_field, validate). ViewSets: ModelViewSet (CRUD in one class), custom actions (@action decorator). Routers: DefaultRouter auto-generates URL patterns. Browsable API (DRF's built-in API explorer). Pagination: PageNumberPagination, LimitOffsetPagination. Filtering: django-filter integration, SearchFilter, OrderingFilter.
1.5 Request Validation & Error Handling
Serializer validation: field-level (validate_email), object-level (validate), custom validators. raise serializers.ValidationError with structured errors. Custom exception handler: override DRF's default to return consistent error format. HTTP status codes: 400 (validation), 401 (auth), 403 (permission), 404 (not found), 500 (server). Error response contract with the frontend team.
1.6 Admin Panel & Django Shell
Django admin: register models, customise list_display, list_filter, search_fields. ModelAdmin for advanced customisation: inline editing, custom actions, fieldsets. django-admin-interface for modern admin UI. Django shell (manage.py shell_plus): interactive ORM queries for debugging. Admin is a PRODUCTIVITY TOOL — not a customer-facing UI. Use it for data management during development.
1.7 Environment Config & Settings Management
django-environ: load settings from .env files. Separate settings: base.py, development.py, production.py. SECRET_KEY, DEBUG, ALLOWED_HOSTS, DATABASE_URL from environment variables. Never commit secrets to Git. python-decouple as an alternative. The 12-Factor App pattern applied to Django. Why settings.py with hardcoded values breaks in production.
Placement relevance: Django + DRF is the #1 Python backend framework for enterprise applications — used at Instagram, Spotify, Dropbox, and most Python-stack Indian startups. "Build a REST API with DRF" is the standard Python full-stack interview assignment. Understanding serializers, ViewSets, and the ORM is what separates "Django tutorial follower" from "Django developer."