From 1781ca53db106324fa6d9a91cc41db8cd3ef168f Mon Sep 17 00:00:00 2001 From: phzhik Date: Sun, 28 Apr 2024 01:06:03 +0400 Subject: [PATCH] + load .env file via dotenv library --- poizonstore/settings.py | 4 +++- requirements.txt | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/poizonstore/settings.py b/poizonstore/settings.py index 759aa49..3766699 100644 --- a/poizonstore/settings.py +++ b/poizonstore/settings.py @@ -14,6 +14,9 @@ from pathlib import Path import sentry_sdk from django.core.exceptions import ImproperlyConfigured +from dotenv import load_dotenv +load_dotenv() + # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -34,7 +37,6 @@ def get_secret(setting): # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = get_secret("SECRET_KEY") - # External API settings CDEK_CLIENT_ID = get_secret("CDEK_CLIENT_ID") CDEK_CLIENT_SECRET = get_secret("CDEK_CLIENT_SECRET") diff --git a/requirements.txt b/requirements.txt index 1c18fcb..17aff03 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,6 +23,7 @@ aiohttp==3.9.4 tqdm==4.65.0 django-debug-toolbar==4.1.0 requests==2.31.0 +python-dotenv==1.0.1 # Logging sentry-sdk==1.34.0