aboutsummaryrefslogtreecommitdiff
path: root/app/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/__init__.py')
-rw-r--r--app/__init__.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/__init__.py b/app/__init__.py
index 7145f96..1c759e7 100644
--- a/app/__init__.py
+++ b/app/__init__.py
@@ -3,12 +3,16 @@ from flask import Flask
from flask_bcrypt import Bcrypt
from flask.cli import AppGroup
from flask_sqlalchemy import SQLAlchemy
+import flask_login
app = Flask(__name__)
app.config.from_object('app.config')
bcrypt = Bcrypt(app)
db = SQLAlchemy(app)
+login_manager = flask_login.LoginManager()
+
+login_manager.init_app(app)
from app.models import User
@@ -22,5 +26,8 @@ def delete_database():
app.cli.add_command(database_cli)
+from app.views import main
-from app.views import main \ No newline at end of file
+@login_manager.user_loader
+def load_user(email):
+ return User.query.filter(User.email == email).first() \ No newline at end of file