🐍 Course Overview
Django is the most battle-tested web framework in Python — powering Instagram, Pinterest, Mozilla, Eventbrite, and thousands of SaaS products worldwide. Its "batteries-included" philosophy means authentication, admin, ORM, migrations, and security come built-in, letting teams move from idea to production faster than almost any other stack.
This course teaches Django as senior engineers use it in production — with Django REST Framework for REST APIs, Strawberry for GraphQL, Celery for background tasks, and Django Channels for real-time features. The Next.js 15 frontend consumes the Django API with full TypeScript type safety and a polished deployment pipeline on AWS.
💡 Why Django + Next.js in 2026
Django's ORM, admin panel, and built-in security save weeks of setup — the most productive Python backend framework for full-featured applications
Django REST Framework remains the industry standard for Python REST APIs — mature, well-documented, and supported by a vast ecosystem of extensions
Python's dominance in AI and data science makes Django the natural choice when a web app needs to sit alongside ML models or LLM integrations
Next.js 15 App Router with React Server Components is the most capable frontend framework — server-side rendering, streaming, and static generation in one system
Strong remote demand: Django engineers with modern REST API and Next.js skills are highly sought after at international product companies
Expanded Python ecosystem in 2026 — FastAPI, Litestar, and Django Ninja alternatives covered as optional add-on modules
📚 Curriculum — Module Breakdown
Not a Python introduction. Covers modern Python language features that Django production code depends on, and Django's architecture from the ground up — the parts most tutorial courses skip over.
- Python 3.12+ features in production: type hints, TypedDict, Protocol, dataclasses, structural pattern matching, and the walrus operator
- Type annotations in depth: generics, Self type, ParamSpec, TypeVarTuple, and annotating complex data structures
- Pydantic v2: fastest Python data validation — models, validators, computed fields, serialisation, and Django integration
- Async Python: asyncio fundamentals, async/await, event loops, and Django's async support
- Python packaging with uv: the fast modern replacement for pip and virtualenv
- pyproject.toml: standard project configuration, replacing setup.py and requirements.txt
- Django project structure: apps, settings split by environment, BASE_DIR, and manage.py
- Django settings best practices: django-environ, separate dev/staging/prod settings, SECRET_KEY management
- Django's MVT architecture: models, views, templates, URL dispatcher, and the request/response cycle
- Django apps: modular app architecture — creating apps, AppConfig, and AppConfig.ready()
- Django signals: pre_save, post_save, pre_delete, post_delete, and custom signals
- Custom management commands: writing commands for maintenance tasks and data migrations
- Testing with pytest-django: fixtures, the Django test client, and database transaction isolation
- factory_boy: generating test data with factory classes — replacing manual fixture files
- Ruff: the Rust-powered Python linter and formatter replacing flake8, isort, and black in one tool
- mypy with Django stubs: static type checking for Django projects — django-stubs and djangorestframework-stubs
Django's ORM in production depth — the patterns that keep queries fast, migrations safe, and data models clean at scale.
- Model design: field types, field options, Meta class, verbose names, and model inheritance (abstract, proxy, multi-table)
- Relationships: ForeignKey, OneToOneField, ManyToManyField — related_name, related_query_name, and the reverse manager
- Custom model managers and querysets: encapsulating common query logic in reusable manager methods
- QuerySet API in depth: filter, exclude, annotate, aggregate, values, select_related, prefetch_related, defer, only
- The N+1 problem: identifying it with django-debug-toolbar and solving with select_related and prefetch_related
- F expressions and Q objects: database-level arithmetic, complex filters, and avoiding race conditions
- Annotations and aggregations: Count, Sum, Avg, Min, Max, and custom database expressions
- Raw SQL in Django: Manager.raw(), connection.cursor(), and when raw SQL is the right choice
- Django migrations: creating, squashing, running — data migrations with RunPython, handling team conflicts
- Database transactions: atomic(), select_for_update(), and handling deadlocks
- Soft deletes: implementing deleted_at pattern with a custom manager
- PostgreSQL-specific features with psycopg3: JSONField, ArrayField, HStoreField, and full-text search
- Django model constraints: UniqueConstraint, CheckConstraint, and database-level data integrity
- Connection pooling with PgBouncer: managing PostgreSQL connections for high-traffic applications
- Database performance: EXPLAIN ANALYZE from Django, django-silk for query profiling, and index strategy
DRF thoroughly — from serialisers and viewsets to JWT authentication, permissions, rate limiting, and the advanced patterns enterprise APIs require.
- DRF architecture: APIView, GenericAPIView, mixins, and ViewSets — the full inheritance hierarchy
- Serialisers: ModelSerializer, Serializer, nested serialisers, SerializerMethodField, writable nested serialisers
- Serialiser validation: field-level, object-level validation, and UniqueTogetherValidator
- Routers: DefaultRouter, SimpleRouter, and custom routes with @action
- Filtering: django-filter integration — FilterSet classes, search fields, and ordering fields
- Pagination: PageNumberPagination, LimitOffsetPagination, CursorPagination
- Authentication: SessionAuthentication, TokenAuthentication, and JWT with djangorestframework-simplejwt
- JWT in depth: access tokens, refresh tokens, token rotation, token blacklisting, and custom claims
- Permissions: IsAuthenticated, IsAdminUser, custom permission classes, and object-level permissions
- Throttling: AnonRateThrottle, UserRateThrottle, and custom throttle policies
- API versioning: URL path versioning, namespace versioning, and header versioning
- Content negotiation: supporting multiple response formats from the same endpoint
- Exception handling: custom exception handlers and consistent error response format
- drf-spectacular: generating OpenAPI 3 documentation — schema customisation and Swagger UI
- django-cors-headers: CORS configuration for the Next.js frontend client
- Testing DRF APIs with pytest-django: APIClient, force_authenticate(), testing every endpoint
Strawberry is the modern, type-annotation-first GraphQL library for Python — replacing the older Graphene library. Covers the full stack from schema design to subscriptions.
- GraphQL fundamentals: schema definition, queries, mutations, subscriptions, and the N+1 problem
- Strawberry: Python-first GraphQL using dataclasses and type annotations — no string-based schemas
- Strawberry types: @strawberry.type, @strawberry.input, @strawberry.enum, and @strawberry.interface
- Resolvers: field resolvers, root value resolvers, and the info object for accessing request context
- Django integration: strawberry-graphql-django for generating types and resolvers from Django models
- DataLoader: solving the N+1 problem in GraphQL — batching and caching database lookups per request
- Authentication in Strawberry: accessing Django request and validating JWT tokens in resolvers
- Permissions in Strawberry: the @strawberry.permission_class decorator for field-level authorisation
- Mutations: creating, updating, and deleting data — input validation and error handling
- GraphQL subscriptions with Django Channels: real-time data over WebSockets
- File uploads in GraphQL: the multipart request spec and handling uploads in Strawberry
- Relay-style pagination: cursor-based pagination with the Connection type
- Testing Strawberry GraphQL: using the Strawberry test client for unit and integration testing
- REST vs GraphQL decision framework: when to expose REST, when GraphQL adds value, running both
Multi-layered security for production Django applications — from social login to fine-grained object permissions to full security hardening.
- Django authentication system: User model, AbstractUser vs AbstractBaseUser, and custom user models
- django-allauth: email/password, social OAuth (Google, GitHub, Apple), email verification, password reset
- djangorestframework-simplejwt: JWT for DRF — access/refresh token flow, claims, and blacklisting
- Social authentication for APIs: connecting OAuth providers to DRF consumed by Next.js
- Role-based access control: django-guardian for per-object permissions and custom RBAC with Django groups
- Row-level security: filtering querysets based on the authenticated user — the ownership pattern
- Multi-factor authentication: TOTP-based 2FA with django-otp and QR code generation
- API key authentication: generating and managing long-lived API keys for programmatic access
- Django security checklist: DEBUG=False enforcement, ALLOWED_HOSTS, HTTPS settings, CSRF, clickjacking protection
- SQL injection prevention: Django ORM parameterisation and safe raw query patterns
- django-axes: login attempt throttling and brute force protection
- Content Security Policy: django-csp for setting CSP headers on API responses
The Next.js frontend consumes Django REST Framework and GraphQL APIs — with TypeScript type safety, auto-generated API clients, and the full App Router architecture.
- App Router architecture: server components, client components, layouts, loading states, and error boundaries
- TypeScript API client generation from drf-spectacular OpenAPI spec using openapi-typescript — shared types between Django and Next.js
- Data fetching in server components: async/await directly in components, fetch with cache options, and revalidation
- TanStack Query for client-side data: fetching, caching, background refetch, and optimistic updates against the Django API
- Apollo Client for GraphQL: connecting to the Strawberry Django API — queries, mutations, and subscriptions
- Authentication with NextAuth.js v5: credentials provider connecting to Django JWT, session management, and protected routes
- Next.js Middleware: edge authentication guards and redirecting unauthenticated users
- Server Actions for mutations: calling Django API endpoints from Server Actions — progressive enhancement
- Form handling: React Hook Form with Zod validation, sharing validation logic with Pydantic schemas
- Tailwind CSS v4: utility-first styling, the new CSS-based configuration, and component variants with cva()
- shadcn/ui: accessible component library built on Radix UI — the standard Next.js component system
- TanStack Table: server-side sorted, filtered, and paginated tables backed by DRF's pagination and filtering
- Real-time with Django Channels: consuming Django WebSocket connections from Next.js client components
- File uploads: drag-and-drop UI with progress tracking connecting to the Django file upload endpoint
- Internationalisation with next-intl: multi-language Next.js applications backed by Django's translation
- Metadata API: dynamic SEO from server components — Open Graph, Twitter cards, and JSON-LD
- Playwright E2E testing: full browser tests covering the complete Django + Next.js stack
Production infrastructure that takes Django from working locally to running reliably under real traffic — asynchronous task processing, real-time features, caching, observability, and deployment.
- Celery architecture: workers, brokers (Redis, RabbitMQ), result backends, and the task lifecycle
- Defining tasks: @shared_task, @app.task, task options — retry, max_retries, countdown, eta
- Task chaining: chain(), group(), chord(), and canvas primitives for complex task workflows
- Periodic tasks with Celery Beat: cron-style scheduled tasks with django-celery-beat
- Celery Flower: real-time monitoring dashboard for workers and tasks
- Error handling: automatic retries, exponential backoff, dead-letter handling, and failure notifications
- Task priority queues: routing tasks to dedicated workers for SLA-sensitive workloads
- Channels architecture: ASGI server (Daphne/Uvicorn), channel layers, consumers, and routing
- WebSocket consumers: AsyncWebsocketConsumer — connect, receive, send, and disconnect lifecycle
- Channel layers with Redis: broadcasting messages to groups of connected clients
- Authentication in Channels: authenticating WebSocket connections using JWT tokens
- Real-time notifications: pushing database changes to connected Next.js clients via WebSockets
- GraphQL subscriptions over WebSockets: Strawberry subscriptions with Django Channels transport
- Presence tracking: tracking which users are online with channel groups and Redis
- Django cache framework: cache API, backends (Redis, Memcached), and cache key versioning
- django-redis: Redis cache backend — configuration, connection pooling, and serialisation
- Low-level cache API and DRF response caching with conditional request support
- Structured logging with structlog: JSON log output, bound loggers, and context variables
- OpenTelemetry Python SDK: automatic instrumentation for Django, DRF, Celery — exporting to Jaeger/Tempo
- Sentry for Django: error tracking, performance monitoring, and release tracking
- ASGI deployment: Uvicorn + Gunicorn for both HTTP and WebSocket support
- Docker for Django: multi-stage Dockerfile — separate images for web, Celery worker, and Celery Beat
- Docker Compose: full local stack — Django, Next.js, PostgreSQL, Redis, Celery, Flower, and Nginx
- Static files and media: WhiteNoise for static files, S3-compatible storage for media
- Django deployment checklist: collectstatic, ALLOWED_HOSTS, SECRET_KEY rotation, and HTTPS enforcement
- GitHub Actions CI/CD: Ruff, mypy, pytest, Next.js build, Docker push, and deployment pipeline
🔌 Optional Add-On Modules
AWS Deployment Track
ECS Fargate for Django, RDS PostgreSQL, ElastiCache Redis, SQS, S3 with django-storages, Lambda with Mangum, CloudFront CDN, CDK IaC in Python, and full GitHub Actions CI/CD pipeline.
Google Cloud Deployment
Cloud Run for Django, Cloud SQL PostgreSQL, Memorystore Redis, Cloud Storage, Cloud Tasks as Celery alternative, Secret Manager, Terraform, and Cloud Build CI/CD.
Azure Deployment Track
Azure Container Apps, Azure Database for PostgreSQL, Azure Cache for Redis, Service Bus, Blob Storage, Key Vault, Bicep IaC, and Azure DevOps Pipelines CI/CD.
AI Integration Track
LLM APIs from Django (OpenAI, Anthropic, Gemini), streaming responses via SSE, Celery-based AI processing, pgvector embeddings, RAG pipelines, LangChain, LlamaIndex, and AI-powered Django Admin.
FastAPI Alternative Track
FastAPI with SQLAlchemy 2.0 async, Alembic migrations, OAuth2 JWT, WebSockets, SSE, TestClient testing, and a practical Django-to-FastAPI migration walkthrough.
Litestar & Django Ninja
Django Ninja for FastAPI-style APIs without leaving Django. Litestar as a high-performance ASGI framework — DTOs, dependency injection, SQLAlchemy plugin, and the decision framework for 2026.
🛠️ Core Tools & Technologies
📅 Schedule & Timings
Weekday Groups
Weekend Groups
📍 Location: In-house training in Islamabad · 📱 Online option available for out-of-city participants