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:
parent
e95a8b6e18
commit
b5ef937a03
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user