Django comes with specific settings for SSL support. Edit the settings/pro.py settings file and add the following settings to it:
SECURE_SSL_REDIRECT = True
CSRF_COOKIE_SECURE = True
These settings are as follows:
- SECURE_SSL_REDIRECT: Whether HTTP requests have to be redirected to HTTPS
- CSRF_COOKIE_SECURE: Has to be set for establishing a secure cookie for the cross-site request forgery protection
Congratulations! You have configured a production environment that will offer great performance for serving your project.