Problem Statement
According to Twelve-Factor principles, where should app configuration live?
Explanation
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.
Code Solution
SolutionRead Only
import os
DB_URL = os.environ['DATABASE_URL']
DEBUG = os.getenv('DEBUG','0')=='1'