From 436d2a3ca5a7bd00fa7ac74abb1e04a058411588 Mon Sep 17 00:00:00 2001 From: dmir2470 Date: Wed, 3 Apr 2024 10:53:34 +1100 Subject: [PATCH] Add dotenv config for development env and fix startup bug --- unitrack/settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/unitrack/settings.py b/unitrack/settings.py index 8a3d427..5e94405 100644 --- a/unitrack/settings.py +++ b/unitrack/settings.py @@ -12,6 +12,7 @@ import os from pathlib import Path +from dotenv import load_dotenv # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -32,6 +33,7 @@ # 'DJANGO_ALLOWED_HOSTS' should be a single string of hosts with a space between each. # For example: 'DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]' +load_dotenv(".env.dev") ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ") # Application definition