From b5ef937a03f01fb557bd7e7ba60f040ee5411722 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 9 Mar 2021 09:39:57 +0100 Subject: [PATCH] Environment file path is absolute Signed-off-by: Yohann D'ANELLO --- note_kfet/settings/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/note_kfet/settings/__init__.py b/note_kfet/settings/__init__.py index 3d995367..3aa115f9 100644 --- a/note_kfet/settings/__init__.py +++ b/note_kfet/settings/__init__.py @@ -12,7 +12,7 @@ def read_env(): directory. """ try: - with open('.env') as f: + with open(os.path.join(BASE_DIR, '.env')) as f: content = f.read() except IOError: content = '' @@ -30,6 +30,7 @@ def read_env(): # Try to load environment variables from project .env +BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) read_env() # Load base settings