1. According to Twelve-Factor principles, where should app configuration live?
Env vars let you change configuration per environment without code edits. They are easy to inject in containers and CI/CD. Read them once at startup and validate. Do not hard-code secrets or hostnames in code.
import os
DB_URL = os.environ['DATABASE_URL']
DEBUG = os.getenv('DEBUG','0')=='1'