From eac6cac7bcae4722486d9cbc5edf5f9f73b3e3d9 Mon Sep 17 00:00:00 2001 From: viveksantayana Date: Sat, 11 Jun 2022 02:56:38 +0100 Subject: [PATCH] Restore --- ref-test/app/__init__.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/ref-test/app/__init__.py b/ref-test/app/__init__.py index 136fdb9..2555c94 100644 --- a/ref-test/app/__init__.py +++ b/ref-test/app/__init__.py @@ -23,26 +23,26 @@ def create_app(): app.config.from_object(Config()) app.wsgi_app = ProxyFix(app.wsgi_app, x_proto= 1, x_host= 1) - # bootstrap.init_app(app) - # csrf.init_app(app) - # db.init_app(app) - # login_manager.init_app(app) - # mail.init_app(app) + bootstrap.init_app(app) + csrf.init_app(app) + db.init_app(app) + login_manager.init_app(app) + mail.init_app(app) - # login_manager.login_view = 'admin._login' - # @login_manager.user_loader - # def _load_user(user_id): - # pass + login_manager.login_view = 'admin._login' + @login_manager.user_loader + def _load_user(user_id): + pass - # @app.errorhandler(404) - # def _404_handler(error): - # return jsonify({'error':'404 — Not Found'}), 404 - # @app.errorhandler(CSRFError) - # def _csrf_handler(): - # return jsonify({'error':'Could not validate a secure connection.'}), 403 - # @app.context_processor - # def _now(): - # return {'now': datetime.utcnow()} + @app.errorhandler(404) + def _404_handler(error): + return jsonify({'error':'404 — Not Found'}), 404 + @app.errorhandler(CSRFError) + def _csrf_handler(): + return jsonify({'error':'Could not validate a secure connection.'}), 403 + @app.context_processor + def _now(): + return {'now': datetime.utcnow()} app.register_blueprint(admin, url_prefix='/admin') app.register_blueprint(api, url_prefix='/api')