本文整理匯總了Python中flask.app.Flask.provider方法的典型用法代碼示例。如果您正苦於以下問題:Python Flask.provider方法的具體用法?Python Flask.provider怎麽用?Python Flask.provider使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類flask.app.Flask
的用法示例。
在下文中一共展示了Flask.provider方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: oidc_provider_init_app
# 需要導入模塊: from flask.app import Flask [as 別名]
# 或者: from flask.app.Flask import provider [as 別名]
def oidc_provider_init_app(name=None, config=None):
name = name or __name__
app = Flask(name)
app.config.from_envvar(SE_LEG_PROVIDER_SETTINGS_ENVVAR)
if config:
app.config.update(config)
# Init logging
app = init_logging(app)
# Init middleware
app.wsgi_app = LocalhostMiddleware(app.wsgi_app, server_name=app.config['SERVER_NAME'])
# Initialize registry for plugin handling
r = Registry(app=app)
r['packages'] = PackageRegistry(app)
r['extensions'] = ExtensionRegistry(app)
r['config'] = ConfigurationRegistry(app)
r['blueprints'] = BlueprintAutoDiscoveryRegistry(app=app)
# Init dbs
app.authn_requests = OpStorageWrapper(app.config['DB_URI'], 'authn_requests')
app.users = OpStorageWrapper(app.config['DB_URI'], 'userinfo')
# Init queues
app = init_redis_connection(app)
app.authn_response_queue = rq.Queue('authn_responses', connection=app.redis)
app.authn_response_delay_queue = Scheduler(queue_name='authn_responses', connection=app.redis)
# Set up views
from .views.oidc_provider import oidc_provider_views
app.register_blueprint(oidc_provider_views)
from .views.status import status_views
app.register_blueprint(status_views)
# Initialize the oidc_provider after views to be able to set correct urls
app.provider = init_oidc_provider(app)
return app