def init_app(app): bootstrap.init_app(app) Captcha(app) Error(app) App(app, json=CustomJSONEncoder) Middleware(app) Logging(app)
def init_app(app): Bootstrap(app, css=('css/base.css', 'css/main.css', 'css/monokai.css', 'css/lib.css', 'css/timeline.css', 'css/night.css'), js=('js/main.js', 'js/highlight.js', 'js/night.js'), auth=False) Captcha(app) Error(app) App(app, json=CustomJSONEncoder) Middleware(app) Logging(app)
@babel.timezoneselector def get_timezone(): return 'UTC' return babel db = db csrf = CSRFProtect() cache = Cache() babel = register_babel() mail = Mail() login_manager = register_login() redis_data = Redis() middleware = Middleware() maple_app = App(json=CustomJSONEncoder) def init_app(app): db.init_app(app) csrf.init_app(app) cache.init_app(app) babel.init_app(app) mail.init_app(app) login_manager.init_app(app) redis_data.init_app(app) middleware.init_app(app) maple_app.init_app(app) register_maple(app)