From 5121e44991bb71208520efb117310f9e3b522011 Mon Sep 17 00:00:00 2001 From: Apoorva Pendse Date: Sat, 9 Nov 2024 20:20:28 +0530 Subject: [PATCH] fix : read environment variables from .env in settings.py (#2883) --- blt/settings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/blt/settings.py b/blt/settings.py index 6d6643466..2d2b7fd7c 100644 --- a/blt/settings.py +++ b/blt/settings.py @@ -15,12 +15,15 @@ import environ from django.utils.translation import gettext_lazy as _ -env = environ.Env() # reading .env file environ.Env.read_env() # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(__file__)) +env = environ.Env() +env_file = os.path.join(BASE_DIR, ".env") +environ.Env.read_env(env_file) + PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) GITHUB_TOKEN = os.environ.get("GITHUB_TOKEN", "blank")