def init_app(app): app.teardown_appcontext(app_teardown) app.before_request(before_request) for error in range(400, 420) + range(500, 506): app.error_handler_spec[None][error] = http_error_handler app.register_error_handler(ResponseMeta, response_meta_handler) app.register_error_handler(Exception, generic_error_handler) from utils.mail import Mail Mail.init_app(app) # 注册接口 from website.api import api from website.web import web from website.wx import wx from website.application import app as application from website.message import root as message from website.account import account from website.question import question from website import customer app.register_blueprint(web) app.register_blueprint(api) app.register_blueprint(wx) app.register_blueprint(application) app.register_blueprint(question) app.register_blueprint(message) app.register_blueprint(account) app.register_blueprint(customer.app)
def init_app(app): app.teardown_appcontext(app_teardown) app.before_request(before_request) for error in range(400, 420) + range(500, 506): app.error_handler_spec[None][error] = http_error_handler app.register_error_handler(ResponseMeta, response_meta_handler) app.register_error_handler(Exception, generic_error_handler) from utils.mail import Mail from utils.sentry import Sentry Mail.init_app(app) Sentry.init_app(app) # 注册接口 from api import api from web import web app.register_blueprint(web) app.register_blueprint(api)
def init_app(app): app.teardown_appcontext(app_teardown) app.before_request(before_request) for error in range(400, 420) + range(500, 506): app.error_handler_spec[None][error] = http_error_handler app.register_error_handler(ResponseMeta, response_meta_handler) app.register_error_handler(Exception, generic_error_handler) from utils.mail import Mail Mail.init_app(app) # 注册接口 from api import api from web import web from store import store from account import account app.register_blueprint(web) app.register_blueprint(api) app.register_blueprint(store) app.register_blueprint(account)