Bird
0
0

You run manage.py check --deploy and get a warning about SECURE_CONTENT_TYPE_NOSNIFF. What is the likely cause?

medium📝 Debug Q6 of 15
Django - Security Best Practices
You run manage.py check --deploy and get a warning about SECURE_CONTENT_TYPE_NOSNIFF. What is the likely cause?
AThe setting is set to True
BThe setting is missing or set to False
CThe setting is misspelled in settings.py
DThe setting is deprecated and ignored
Step-by-Step Solution
Solution:
  1. Step 1: Understand the setting purpose

    SECURE_CONTENT_TYPE_NOSNIFF prevents browsers from MIME sniffing, improving security.
  2. Step 2: Identify cause of warning

    If missing or False, the deploy check warns because this reduces protection against attacks.
  3. Final Answer:

    The setting is missing or set to False -> Option B
  4. Quick Check:

    Missing or False triggers warning = B [OK]
Quick Trick: Set SECURE_CONTENT_TYPE_NOSNIFF = True in production [OK]
Common Mistakes:
MISTAKES
  • Assuming True causes warning
  • Ignoring spelling mistakes
  • Thinking setting is deprecated

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes