Skip to content
Snippets Groups Projects
Verified Commit b5ef937a authored by ynerant's avatar ynerant
Browse files

Environment file path is absolute


Signed-off-by: ynerant's avatarYohann D'ANELLO <ynerant@crans.org>
parent e95a8b6e
No related branches found
No related tags found
3 merge requests!162Bugs mineurs, documentation,!157[Invoices] Product quantities can be floating,!155CAS + OAuth2
...@@ -12,7 +12,7 @@ def read_env(): ...@@ -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(): ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment