From 2ef755ad3d15f1ccce1cc9f6e5020bff35a2216e Mon Sep 17 00:00:00 2001 From: Michaƫl Ball Date: Fri, 27 Nov 2015 19:33:39 +0000 Subject: Login manager --- mach2.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mach2.py b/mach2.py index 1b3f068..dfe7452 100644 --- a/mach2.py +++ b/mach2.py @@ -25,6 +25,10 @@ config.read("mach2.ini") app.config["DEBUG"] = config["DEFAULT"]["debug"] +login_manager = LoginManager() +login_manager.login_view = "login" +login_manager.session_protection = "strong" + def get_db(): db = getattr(g, "_database", None) @@ -159,4 +163,5 @@ if __name__ == "__main__": config = configparser.ConfigParser() config.read("mach2.ini") - app.run(debug=config["DEFAULT"]["debug"]) + login_manager.init_app(app) + app.run() -- cgit v1.2.3