Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Get all configuration variables from just one place. #70

Open
tsrivishnu opened this issue Aug 11, 2016 · 0 comments
Open

Refactor: Get all configuration variables from just one place. #70

tsrivishnu opened this issue Aug 11, 2016 · 0 comments
Assignees

Comments

@tsrivishnu
Copy link
Collaborator

tsrivishnu commented Aug 11, 2016

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.

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/
      __init__.py # Empty, just here to tell Python that it's a package.
      default.py
      production.py
      development.py
  • config/default.py will be checked in into the source code. So define secrets as empty strings.

  • we will load the configuration in app/__init__.py depending on the environment the app is running in or just load the default.

  • config/production.py and config/development.py will not be checked in into the source control.

Reference:

@tsrivishnu tsrivishnu self-assigned this Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant