pip install python-decouple
KEY=VALUE
API_KEY=your-api-key
python
from decouple import config
python
api_key = config('API_KEY')
python
debug_mode = config('DEBUG_MODE', cast=bool)
python
port = config('PORT', cast=int)
python
allowed_ips = config('ALLOWED_IPS', cast=lambda v: [s.strip() for s in v.split(',')])
python
database_url = config('DATABASE_URL', default='localhost')
python
from decouple import config, Csv
config = config()
config.COMMENT_MARK = '#'