About Lesson
Deployment involves transitioning your application from a development environment to a production-ready state.
Key Differences Between Development and Production
- Debugging Mode:
- In development:
DEBUG = True
(enables detailed error pages). - In production:
DEBUG = False
(hides sensitive information).
- In development:
- Allowed Hosts:
- Restrict which domains can access your application using the
ALLOWED_HOSTS
setting.
- Restrict which domains can access your application using the
- Static and Media Files:
- Use
collectstatic
to prepare static files for serving in production. - Store media files securely.
- Use
- Secure Dependencies:
- Use a
requirements.txt
orpoetry.lock
file to define dependencies. - Update regularly to patch vulnerabilities.
- Use a