1. Home
  2. Computer Science MCQs
  3. Django
  4. When DEBUG = False in Django settings, which setting must…

Added 2 Nov 2026

When DEBUG = False in Django settings, which setting must list the domains the site may serve?

  1. INSTALLED_APPS
  2. STATIC_ROOT
  3. ALLOWED_HOSTS Correct answer
  4. SECRET_KEY

Correct answer

C. ALLOWED_HOSTS

15 views

MCQSEXAM

Explanation

With debug off, Django refuses requests whose Host header is not in ALLOWED_HOSTS, which protects against HTTP Host header attacks. Never run production with DEBUG = True.

Reference

Asked in: Python Developer Interviews, NTS

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Django MCQs

Practise all Django MCQs

Similar MCQs