-
Notifications
You must be signed in to change notification settings - Fork 342
/
__init__.py
50 lines (38 loc) · 1.07 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# encoding: utf-8
# pylint: disable=invalid-name,wrong-import-position,wrong-import-order
"""
Extensions setup
================
Extensions provide access to common resources of the application.
Please, put new extension instantiations and initializations here.
"""
from .logging import Logging
logging = Logging()
from flask_cors import CORS
cross_origin_resource_sharing = CORS()
from .flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
from sqlalchemy_utils import force_auto_coercion, force_instant_defaults
force_auto_coercion()
force_instant_defaults()
from flask_login import LoginManager
login_manager = LoginManager()
from flask_marshmallow import Marshmallow
marshmallow = Marshmallow()
from .auth import OAuth2Provider
oauth2 = OAuth2Provider()
from . import api
def init_app(app):
"""
Application extensions initialization.
"""
for extension in (
logging,
cross_origin_resource_sharing,
db,
login_manager,
marshmallow,
api,
oauth2,
):
extension.init_app(app)