Blame view

flaskr/extensions.py 634 Bytes
16f69d07   Antoine Goutenoir   Add an (unsecured...
1
from flask_admin import Admin
b9fc86c3   Antoine Goutenoir   Secure the admin ...
2
from flask_basicauth import BasicAuth
94906fa5   Goutte   Add flask extensi...
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from flask_caching import Cache
from flask_debugtoolbar import DebugToolbarExtension
from flask_login import LoginManager
from flask_assets import Environment

from flaskr.models import User

# Setup flask cache
cache = Cache()

# init flask assets
assets_env = Environment()

debug_toolbar = DebugToolbarExtension()

login_manager = LoginManager()
login_manager.login_view = "main.login"
login_manager.login_message_category = "warning"

16f69d07   Antoine Goutenoir   Add an (unsecured...
22
admin = Admin()
b9fc86c3   Antoine Goutenoir   Secure the admin ...
23
basic_auth = BasicAuth()
16f69d07   Antoine Goutenoir   Add an (unsecured...
24

94906fa5   Goutte   Add flask extensi...
25
26
27
28

@login_manager.user_loader
def load_user(userid):
    return User.query.get(userid)