In a Django project, if you set DEBUG = True in settings.py, what is the expected behavior when an error occurs during a request?
Think about what helps developers find bugs during development.
When DEBUG is True, Django shows a detailed error page with the stack trace and local variables to help developers debug issues.
In Django, when DEBUG is set to True, which of the following is true about serving static files during development?
Think about what makes development easier without extra setup.
When DEBUG is True, Django serves static files automatically using the django.contrib.staticfiles app, simplifying development.
In Django, if DEBUG = False and ALLOWED_HOSTS = [], what happens when you try to access the site?
Think about security restrictions when DEBUG is off.
When DEBUG is False, Django requires ALLOWED_HOSTS to be set. If empty, it raises a DisallowedHost exception and returns a 400 error.
When DEBUG is True, how does Django handle template loading compared to when DEBUG is False?
Think about what helps developers see changes quickly.
With DEBUG=True, Django reloads templates on every request so developers see changes immediately without restarting the server.
Which of the following is the main reason to never set DEBUG = True in a production Django environment?
Think about what information error pages show when debugging is on.
DEBUG=True shows detailed error pages that can reveal sensitive data, which attackers could exploit. This is why it must be off in production.