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

Add support to read environment variables #51

Merged
merged 1 commit into from Jun 23, 2018

Conversation

isabelcosta
Copy link
Member

@isabelcosta isabelcosta commented Jun 19, 2018

Description

  • Currently reading SECRET_KEY and ENVIRONMENT_CONFIGURATION from environment variables;
  • Updated README to inform of what variables to use on .env file;
  • Raising error with environment configuration is not in these values: dev, test or prod;
  • Updated test_app_config.py according to changes.

With these changes, we can set sensitive data on the .env file and import them without hardcoding it on the code

Fixes #21

Type of Change:

  • Code
  • Quality Assurance
  • Documentation

Code/Quality Assurance Only

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update (software upgrade on readme file)
  • New feature (non-breaking change which adds functionality pre-approved by mentors)

How Has This Been Tested?

  • Ran unittest test_config_app.py (fixed tests according to this change)
  • created .env file with exported with different types of configurations, to test if the app only accepted dev, test and prod how it should

Checklist:

  • My PR follows the style guidelines of this project
  • I have performed a self-review of my own code or materials
  • I have commented my code or provided relevant documentation, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Code/Quality Assurance Only

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Contributor

@m-murad m-murad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@isabelcosta
please include a sample .env file in the repo.
In readme.md write the steps that the user will need to follow to update the .env file.
Lastly, include the .env file in the .gitignore file.

@m-murad
Copy link
Contributor

m-murad commented Jun 23, 2018

Also, remove the sample .env file from readme.md

@isabelcosta
Copy link
Member Author

@m-murad

the .env file is already on README, so I should remove from it, add the template and then add it again to .gitignore? Won't that create an extra step everytime we want to add a new environment variable to the template?

Instead, should I create a file such as .env_template, that is updated everytime a new env variable is needed?

@m-murad
Copy link
Contributor

m-murad commented Jun 23, 2018

Will explain this in the 1:1

@isabelcosta
Copy link
Member Author

@m-murad changes to the README.md file done

@m-murad m-murad merged commit b56f632 into anitab-org:gsoc18-code Jun 23, 2018
@isabelcosta isabelcosta deleted the 21-load-env-variables branch June 25, 2018 13:51
@isabelcosta isabelcosta added the Program: GSOC Related to work completed during the Google Summer of Code Program. label Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: GSOC Related to work completed during the Google Summer of Code Program.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants