Created
January 31, 2019 12:20
-
-
Save 01x01/3c7d2feca6395e816121945dfb4d0a08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/__init__.py | |
from flask_login import LoginManager | |
login_manager = LoginManager() | |
login_manager.session_protection = "strong" | |
login_manager.login_view = "auth.login |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/auth/models.py | |
from flask_login import UserMixin | |
@login_manager.user_loader | |
def load_user(user_id): | |
return User.get(int(user_id)) | |
class User(UserMixin,db.Model): | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/auth/views.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment