Bird
0
0

How can you programmatically suppress a specific warning from manage.py check --deploy without disabling all checks?

hard📝 Application Q9 of 15
Django - Security Best Practices
How can you programmatically suppress a specific warning from manage.py check --deploy without disabling all checks?
ASet <code>DEBUG = True</code> to ignore warnings
BRemove the related setting from settings.py
CUse the <code>silenced_system_checks</code> setting with the warning code
DRun <code>manage.py check --deploy --ignore</code> with the warning code
Step-by-Step Solution
Solution:
  1. Step 1: Understand suppression method

    Django allows silencing specific system check warnings by listing their codes in silenced_system_checks.
  2. Step 2: Evaluate other options

    Setting DEBUG True or removing settings is insecure; no --ignore flag exists for this command.
  3. Final Answer:

    Use the silenced_system_checks setting with the warning code -> Option C
  4. Quick Check:

    Suppress warnings via silenced_system_checks = B [OK]
Quick Trick: Use silenced_system_checks to silence specific warnings [OK]
Common Mistakes:
MISTAKES
  • Thinking DEBUG True suppresses warnings
  • Trying nonexistent command flags
  • Removing settings instead of silencing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes