flask application context
Rather than passing the application around to each function, the current_app and g proxies are accessed instead.
解決するところ app factory pattern や blueprints, extensionsで、app instanceがいない。
However, importing the app instance within the modules in your project is prone to circular import issues.
私は、globalに保持してたので、解決方法がみえた。