Bird
0
0

Why does manage.py check --deploy require DEBUG = False to pass without warnings?

hard📝 Conceptual Q10 of 15
Django - Security Best Practices
Why does manage.py check --deploy require DEBUG = False to pass without warnings?
ABecause DEBUG True disables database connections
BBecause DEBUG False disables all logging
CBecause DEBUG True exposes detailed error pages that leak sensitive info
DBecause DEBUG False enables static file serving
Step-by-Step Solution
Solution:
  1. Step 1: Understand DEBUG impact

    When DEBUG is True, Django shows detailed error pages that can reveal sensitive data to attackers.
  2. Step 2: Reason why check requires DEBUG False

    To avoid leaking information, production must have DEBUG set to False, which the check enforces.
  3. Final Answer:

    Because DEBUG True exposes detailed error pages that leak sensitive info -> Option C
  4. Quick Check:

    DEBUG True leaks info = C [OK]
Quick Trick: Never deploy with DEBUG True to protect sensitive info [OK]
Common Mistakes:
MISTAKES
  • Believing DEBUG affects logging or DB connections
  • Confusing static file serving with DEBUG
  • Thinking DEBUG False disables logging

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes