Configuration for hosted applications.
WHAT THEY ARE
Values available to your application from its environment, rather than from its code.
WHY USE THEM
Secrets stay out of code and out of version control The same code runs in development and production
WHAT TO PUT IN THEM
Database credentials API keys Any setting that differs between environments A flag indicating the environment
WHERE TO SET THEM
The Python application interface provides a place for them.
WHAT TO DO AFTER CHANGING ONE
Restart the application.
WHAT TO DO IN YOUR CODE
Read them, and fail clearly at startup if a required one is missing.
WHY FAIL AT STARTUP
Better than failing obscurely on the first request that needs it.
WHAT TO PROVIDE FOR DEVELOPMENT
A local file holding the same values, excluded from version control.
WHAT TO COMMIT
An example file with placeholder values.
WHAT NEVER TO DO
Commit real values Log environment variables Display them in error output