Bird
0
0

Why does Django recommend setting SECURE_SSL_REDIRECT = True in production?

hard📝 Conceptual Q10 of 15
Django - Security Best Practices
Why does Django recommend setting SECURE_SSL_REDIRECT = True in production?
ATo enable debug mode for SSL errors
BTo force all HTTP requests to HTTPS, protecting data in transit
CTo disable SSL and speed up connections
DTo allow mixed content (HTTP and HTTPS) on the site
Step-by-Step Solution
Solution:
  1. Step 1: Understand SECURE_SSL_REDIRECT purpose

    This setting forces all HTTP requests to redirect to HTTPS, ensuring encrypted communication.
  2. Step 2: Evaluate other options

    Disabling SSL, enabling debug for SSL, or allowing mixed content reduce security and are incorrect.
  3. Final Answer:

    To force all HTTP requests to HTTPS, protecting data in transit -> Option B
  4. Quick Check:

    SSL redirect = To force all HTTP requests to HTTPS, protecting data in transit [OK]
Quick Trick: Redirect HTTP to HTTPS with SECURE_SSL_REDIRECT = True [OK]
Common Mistakes:
MISTAKES
  • Thinking it disables SSL
  • Confusing with debug mode
  • Allowing mixed content reduces security

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes