本文整理汇总了Python中werkzeug.exceptions.HTTPException.__subclasses__方法的典型用法代码示例。如果您正苦于以下问题:Python HTTPException.__subclasses__方法的具体用法?Python HTTPException.__subclasses__怎么用?Python HTTPException.__subclasses__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类werkzeug.exceptions.HTTPException
的用法示例。
在下文中一共展示了HTTPException.__subclasses__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_app
# 需要导入模块: from werkzeug.exceptions import HTTPException [as 别名]
# 或者: from werkzeug.exceptions.HTTPException import __subclasses__ [as 别名]
def create_app(settings_override=None, register_security_blueprint=False):
app = factory.create_app(__name__, __path__, settings_override, register_security_blueprint)
# Init API endpoints for models
api_manager.init_app(app)
# Setup security async email send
security_ctx = app.extensions['security']
@security_ctx.send_mail_task
def delay_security_email(msg): # pylint: disable=unused-variable
tasks.send_security_email.delay(msg)
# Register custom error handlers so they all return JSON
if not app.debug:
for http_exception_class in HTTPException.__subclasses__():
app.errorhandler(http_exception_class.code)(handle_error)
return app