I'm working on a Python Angular app that integrates Gmail API. I have 3 JSON files for token, credentials, and a specific file which I need to authenticate the Gmail API so my app can generate emails to send to email addresses via OAuth2. I got my app to work using the credentials. I've been wondering about this question.
Is there a way to store those files without committing them to GitHub? I want to host this app on the Heroku platform but I don't want to compromise that by including those JSON files which contain the secret client key, ids, etc.
CodePudding user response:
Environment variables. Here's a Heroku guide: https://devcenter.heroku.com/articles/config-vars
How to use them locally, depends on your OS and/or shell you're using. It can be a .bashrc
file (or .zshrc
or another one like that) in your home directory, it could be something clickable in Windows.
CodePudding user response:
If those values do not change, you can use Heroku config vars, otherwise I suggest trying MongoDB. Here's some guides I found:
- Integrating MongoDB cloud with Python app: https://www.mongodb.com/blog/post/getting-started-with-python-and-mongodb
- Getting started with heroku config vars: https://devcenter.heroku.com/articles/config-vars