I am writing a small Flask app which acts as a shim between third party service and my own code.
I have some information that I know at the time that I create the app (specifically log in credentials), that I want get into route handlers. What is the correct / idiomatic way of doing this?
I tried attaching it to the app
or putting in app.config
but when I run with heroku (which I presume has multiple workers) I don't seem to have this information.
from flask import Flask, gapp = Flask()@app.route('/myroute')def myroute(): config = app.config['config'] # name error config = a..config # name errorif __name__ == '__main__': config = load_config() app.config['config'] = config # not visi # g.config = config # cannot write to g outside a request app.config = config