Complete the code to set a secret key in Django settings.
SECRET_KEY = '[1]'
The SECRET_KEY is a string used by Django for cryptographic signing. It must be set to a unique, unpredictable value.
Complete the code to disable debug mode in production.
DEBUG = [1]In production, DEBUG must be set to False to avoid exposing sensitive information.
Fix the error in the allowed hosts setting to allow only example.com.
ALLOWED_HOSTS = [[1]]The ALLOWED_HOSTS list must contain strings representing allowed domain names. Use quotes around the domain.
Fill both blanks to set secure cookie settings in Django.
SESSION_COOKIE_SECURE = [1] CSRF_COOKIE_SECURE = [2]
Setting both SESSION_COOKIE_SECURE and CSRF_COOKIE_SECURE to True ensures cookies are sent only over HTTPS.
Fill all three blanks to configure Django security settings for HTTPS and headers.
SECURE_SSL_REDIRECT = [1] SECURE_HSTS_SECONDS = [2] SECURE_CONTENT_TYPE_NOSNIFF = [3]
Setting SECURE_SSL_REDIRECT to True redirects HTTP to HTTPS. SECURE_HSTS_SECONDS sets the HSTS header duration (1 year = 31536000 seconds). SECURE_CONTENT_TYPE_NOSNIFF set to True prevents content type sniffing.