From e3503d66173bd6b9f89e3054a7e7ac4f2bde91df Mon Sep 17 00:00:00 2001 From: lucasew Date: Fri, 19 Jan 2024 17:12:14 -0300 Subject: [PATCH] backend: make dotenv optional Signed-off-by: lucasew --- backend/config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/config.py b/backend/config.py index 2a96d018..f31ee16a 100644 --- a/backend/config.py +++ b/backend/config.py @@ -1,4 +1,3 @@ -from dotenv import load_dotenv, find_dotenv import os @@ -14,7 +13,11 @@ from constants import ERROR_MESSAGES from pathlib import Path -load_dotenv(find_dotenv("../.env")) +try: + from dotenv import load_dotenv, find_dotenv + load_dotenv(find_dotenv("../.env")) +except ImportError: + print("dotenv not installed, skipping...") ####################################