I have main.py and app.py. app.py contains create_app() which returns the app object. main.py calls create_app(). I have to construct a mutable global object in main.py. This global object takes app as input parameter. This seems complex to me in python. How do I possibly achieve this global object construction when the application starts up?
Specifically, I am using flask_oidc and needs to construct an oidc = OpenIDConnect(app) in main.py and makes oidc object available in other controller .py files. This oidc object will store user info and validates if a user is authenticated.
Any advice and insight is appreciated.