Beyond the deploy lesson, production Django means observability, safe schema changes, and operational runbooks—not only flipping DEBUG off.
Operations habits
- Health checks and structured logging (request ID, user ID)
- Database backups with tested restores
- Celery/RQ for background jobs (email, reports)—not blocking views
- Rate limiting and CDN for static assets
- Separate settings modules per environment
Performance
Cache expensive querysets (Redis), use database indexes on filter columns, paginate large lists, and monitor slow queries in staging before launch.
Important interview questions and answers
- Q: Where run Celery workers?
A: Separate processes/containers from web workers—share broker (Redis/RabbitMQ) and Django settings. - Q: Cache invalidation?
A: Time-based TTL, version keys, or signal-based busting—pick simplest that meets freshness needs. - Q: Secret rotation?
A: Rotate SECRET_KEY carefully (sessions invalidate); DB credentials via env and IAM where possible.
Self-check
- Why move email sending to a background task?
- What should a backup restore drill prove?