Fixes: None; Extra: None;
Replaced hardcoded host checks with a dynamic check using `ALLOWED_HOSTS` from environment variables. Adjusted exception logging to include tracebacks only when the `DEBUG` environment variable is enabled.