From db7f51f7287af4abf7ed6319cdcb8c2bd4dff256 Mon Sep 17 00:00:00 2001 From: Richard Hitier Date: Thu, 25 Mar 2021 12:36:53 +0100 Subject: [PATCH] Load dotenv file .flaskenv --- app/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+), 0 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 156a792..b027ef7 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -10,6 +10,13 @@ from flask.logging import default_handler from app.models import db, User +from dotenv import load_dotenv + +app_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..') +env_file = os.path.join(app_dir, ".flaskenv") +load_dotenv(env_file, verbose=True) + + login_manager = LoginManager() login_manager.login_view = "auth.login" -- libgit2 0.21.2