Bird
0
0

Which setting must be added to enable WhiteNoise static file compression?

easy📝 Conceptual Q2 of 15
Django - Deployment and Production
Which setting must be added to enable WhiteNoise static file compression?
ADEBUG = True
BSTATIC_ROOT = '/static/'
CSTATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
DALLOWED_HOSTS = ['*']
Step-by-Step Solution
Solution:
  1. Step 1: Identify WhiteNoise compression setting

    The setting STATICFILES_STORAGE with value 'whitenoise.storage.CompressedManifestStaticFilesStorage' enables compression and caching.
  2. Step 2: Understand other options

    STATIC_ROOT sets static files folder, DEBUG controls debug mode, ALLOWED_HOSTS controls allowed domains, none enable compression.
  3. Final Answer:

    STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' -> Option C
  4. Quick Check:

    Compression setting = STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' [OK]
Quick Trick: Use CompressedManifestStaticFilesStorage for compression [OK]
Common Mistakes:
MISTAKES
  • Setting STATIC_ROOT instead of STATICFILES_STORAGE
  • Confusing DEBUG or ALLOWED_HOSTS with compression

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes