1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-23 07:52:23 +00:00

Environment file path is absolute

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-03-09 09:39:57 +01:00
parent e95a8b6e18
commit b5ef937a03
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

@ -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