I'm working on flask apps for simple websites. Currently, all my secret keys and api keys are in a config.py file in my github repo and I configure the flask app via
app.config.from_object('config.Config')
The github repo is private, but this is worst practice. I want to share my github repo with others to collaborate. First, I have to hide all my keys, then I can make the repo public (or create a new one that has never had the keys in it) and then share the repo.
Now I want a boolean to decide how to config, for which I'm currently using:
is_heroku = environ.get('IS_HEROKU', None)
if is_heroku:
app.config.from_prefixed_env()
else:
app.config.from_object('config.Config')
I set a bunch of heroku environment variables in the GUI like so:
Supposedly, if I begin all my environment variables with "FLASK_" and then use app.config.from_prefixed_env(), it will configure using those automatically. It has not. I am not sure what is wrong here or if I should be configuring differently with heroku. The local configuration still works fine.
I'm sorry that I'm quite bad with computers and web development. I'm a math postdoc who is trying to learn programming as a hobby.