Right now, app/__init.py__ reads from config.py which defines few constant variables and also loads few from database.yml and application.yml. Would be nice to just have one place (or at least one file for all variables that are secret or not constant) to look at for all the application variables.
Right now,
app/__init.py__
reads fromconfig.py
which defines few constant variables and also loads few fromdatabase.yml
andapplication.yml
. Would be nice to just have one place (or at least one file for all variables that are secret or not constant) to look at for all the application variables.After some reading, I suggest, we use an approach similar to the one discussed in the Flask guides: http://exploreflask.com/en/latest/configuration.html#configuring-based-on-environment-variables
We will make environment specific configuration files under
config/
directory.config/default.py
will be checked in into the source code. So define secrets as empty strings.app/__init__.py
depending on the environment the app is running in or just load the default.config/production.py
andconfig/development.py
will not be checked in into the source control.Reference: