Store config in ENVs

Main point

The Twelve-Factor App stores config in the environment variables.

  • This definition of ‘config’ does not include internal application controls, such as Django or Flask knobs & flags. This type of settings does not vary between deploys, nor contains sensitive credentials, so is best done in the code.

  • A litmus test for whether an app has its config correctly factored out of the code is whether the codebase could be made open source at any moment without compromising any secrets or credentials.

  • Usually there are multiple ENV files e.g. a separate version for development, staging and production.

    • It is convenient to organise those ENVs in one location. An example of such organisation is present in Big-Bang-py. As a bonus, you can find there Python ENVs loader based on python-dotenv.