1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-27 02:43:01 +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. directory.
""" """
try: try:
with open('.env') as f: with open(os.path.join(BASE_DIR, '.env')) as f:
content = f.read() content = f.read()
except IOError: except IOError:
content = '' content = ''
@ -30,6 +30,7 @@ def read_env():
# Try to load environment variables from project .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() read_env()
# Load base settings # Load base settings