本文整理汇总了Python中flask.app.Flask.users方法的典型用法代码示例。如果您正苦于以下问题:Python Flask.users方法的具体用法?Python Flask.users怎么用?Python Flask.users使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flask.app.Flask
的用法示例。
在下文中一共展示了Flask.users方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: oidc_provider_init_app
# 需要导入模块: from flask.app import Flask [as 别名]
# 或者: from flask.app.Flask import users [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