Django
A comprehensive five-day Django training covering everything from project setup to production deployment. Build full-featured web applications with REST APIs, real-time features, and modern best practices.
Duration
5 days (35 hours)
Format
50 percent presentation, 50 percent exercises
Prerequisites
Solid Python fundamentals required, basic HTML/CSS knowledge recommended
Materials
Virtual machines provided, electronic course materials
Day 1 — Django Foundations
Introduction to Django
- Project setup: django-admin, settings, project structure
- Settings and configuration: databases, static files, environment variables
- Apps architecture: creating apps, app registry, reusable apps
Models
- ORM fundamentals: field types, options, Meta class
- Migrations: makemigrations, migrate, squashing, data migrations
- Relationships: ForeignKey, ManyToManyField, OneToOneField
- QuerySets: filtering, ordering, aggregation, annotation, F and Q objects
Django Admin
- Admin customization: ModelAdmin, list_display, list_filter, search_fields
- Custom actions, inline models, readonly fields
- Admin filters and custom admin views
Day 2 — Views, Templates, and Forms
Views and URLs
- Function-based views: request, response, shortcuts
- Class-based views: ListView, DetailView, CreateView, UpdateView, DeleteView
- Mixins: LoginRequiredMixin, PermissionRequiredMixin, custom mixins
- URL configuration: path, re_path, include, namespaces
Templates
- Template inheritance: extends, block, include
- Template tags and filters: built-in and custom
- Context processors: adding global context data
Forms
- Django forms: Form, ModelForm, validation, cleaning
- Formsets: model formsets, inline formsets
- Static files and media: configuration, serving, storage backends
Day 3 — REST APIs
Django REST Framework
- Serializers: ModelSerializer, nested serializers, validation
- ViewSets and routers: CRUD operations, custom actions
- Authentication: session, token, JWT authentication
- Permissions: built-in permissions, object-level permissions
- Filtering, searching, and pagination
Django Ninja Alternative
- Django Ninja: async-first API framework with type hints
- Pydantic schemas for request and response validation
- Comparing DRF and Django Ninja approaches
API Testing
- Testing APIs with Django test client and DRF test tools
- API documentation with OpenAPI and Swagger
Day 4 — Advanced Topics
Django Internals
- Signals: pre_save, post_save, request lifecycle signals
- Middleware: request/response processing, custom middleware
- Management commands: creating custom commands for automation
- Caching: per-view cache, template fragment cache, low-level cache API
Real-Time and Background Tasks
- Django Channels: WebSocket support, consumers, routing
- Real-time notifications and chat patterns
- Celery for background tasks: tasks, scheduling, result backends
Security
- Security best practices: CSRF, XSS, SQL injection prevention
- Authentication and authorization patterns
- HTTPS, HSTS, and Content Security Policy
Day 5 — Testing, Deployment, and Project
Testing
- Unit tests and integration tests with Django TestCase
- factory_boy: creating test data with factories
- Test coverage: measuring and improving coverage
Deployment
- Docker: containerizing Django applications
- Gunicorn and Uvicorn: WSGI and ASGI servers
- Nginx: reverse proxy configuration
- CI/CD pipeline setup with GitHub Actions or GitLab CI
Performance and Project
- Performance optimization: select_related, prefetch_related, database indexing
- Django Debug Toolbar and profiling
- Practical project: building a complete application from specification to deployment
