I\'m currently using the Flask Application Factory pattern with Blueprints. The issue that I\'m having is how do I access the app.config object outside of the application fa
There is no need to use global names here, that defeats the purpose of using an app factory in the first place.
Within views, such as in your example, current_app is bound to the app handling the current app/request context.
from flask import current_app
@bp.route('/')
def example():
servers = current_app.config['CUPS_SERVERS']
...
If you need access to the app while setting up a blueprint, the record decorator marks functions that are called with the state the blueprint is being registered with.
@bp.record
def setup(state):
servers = state.app.config['CUPS_SERVERS']
...