Bird
0
0

Why is it important to avoid committing environment-based settings like SECRET_KEY directly into version control?

hard📝 Conceptual Q10 of 15
Django - Deployment and Production
Why is it important to avoid committing environment-based settings like SECRET_KEY directly into version control?
ABecause environment variables cannot be used in production
BBecause it slows down the application
CBecause Django does not support environment variables
DBecause it can expose sensitive information publicly
Step-by-Step Solution
Solution:
  1. Step 1: Understand security risks

    Committing secrets exposes them to anyone with repository access or public view.
  2. Step 2: Confirm Django environment variable support

    Django fully supports environment variables; avoiding commit is for security, not performance.
  3. Final Answer:

    Because it can expose sensitive information publicly -> Option D
  4. Quick Check:

    Security risk of committing secrets = C [OK]
Quick Trick: Never commit secrets to version control [OK]
Common Mistakes:
MISTAKES
  • Thinking it affects app speed
  • Believing env vars are unsupported
  • Confusing environment variables with config files

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes