summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaël Ball <michael.ball@gmail.com>2015-11-27 19:33:39 +0000
committerMichaël Ball <michael.ball@gmail.com>2015-11-27 19:33:39 +0000
commit2ef755ad3d15f1ccce1cc9f6e5020bff35a2216e (patch)
tree729dc743a762f2511a61f7dbd30bdc8a2e0ba486
parentdb7de872c4caf8d67784ad257551598a3a0e6035 (diff)
Login manager
-rw-r--r--mach2.py7
1 files changed, 6 insertions, 1 deletions
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()