Commit db7f51f7287af4abf7ed6319cdcb8c2bd4dff256
1 parent
cfa2bae8
Exists in
master
and in
4 other branches
Load dotenv file .flaskenv
Showing
1 changed file
with
7 additions
and
0 deletions
Show diff stats
app/__init__.py
@@ -10,6 +10,13 @@ from flask.logging import default_handler | @@ -10,6 +10,13 @@ from flask.logging import default_handler | ||
10 | 10 | ||
11 | from app.models import db, User | 11 | from app.models import db, User |
12 | 12 | ||
13 | +from dotenv import load_dotenv | ||
14 | + | ||
15 | +app_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..') | ||
16 | +env_file = os.path.join(app_dir, ".flaskenv") | ||
17 | +load_dotenv(env_file, verbose=True) | ||
18 | + | ||
19 | + | ||
13 | login_manager = LoginManager() | 20 | login_manager = LoginManager() |
14 | 21 | ||
15 | login_manager.login_view = "auth.login" | 22 | login_manager.login_view = "auth.login" |