-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinit.py
More file actions
36 lines (29 loc) · 987 Bytes
/
init.py
File metadata and controls
36 lines (29 loc) · 987 Bytes
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
"""
All initializations like db = SQLAlchemy in this file
"""
import os
from flask_login import LoginManager
from flask_mailman import Mail
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
from flask_wtf.csrf import CSRFProtect
# from flask_marshmallow import Marshmallow, uncommented as not updated to support flask 2.x
root_path = os.path.dirname(os.path.abspath(__file__)) # don't remove
static_path = os.path.join(root_path, "static") # don't remove
modules_path = os.path.join(root_path, "modules") # don't remove
themes_path = os.path.join(static_path, "themes") # don't remove
installed_packages = [] # don't remove
installed_packages = []
db = SQLAlchemy()
# ma = Marshmallow()
login_manager = LoginManager()
migrate = Migrate()
mail = Mail()
csrf = CSRFProtect()
def load_extensions(app):
migrate.init_app(app, db)
db.init_app(app)
# ma.init_app(app)
mail.init_app(app)
login_manager.init_app(app)
csrf.init_app(app)