Skip to content

Commit 827a14a

Browse files
committed
fix: read local env only on local and debug mode
1 parent e3e0297 commit 827a14a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

backend/settings.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55

66
# Build paths inside the project like this: BASE_DIR / 'subdir'.
77
BASE_DIR = Path(__file__).resolve().parent.parent
8-
from dotenv import load_dotenv
98

10-
load_dotenv()
9+
if DEBUG:
10+
from dotenv import load_dotenv
11+
12+
load_dotenv()
1113

1214
# SECURITY WARNING: keep the secret key used in production secret!
1315
SECRET_KEY = os.environ.get('SECRET_KEY', '<a string of random characters>')

0 commit comments

Comments
 (0)