Skip to content

Commit

Permalink
updated settings.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Reeya123 committed Jul 9, 2024
1 parent 4e38ce7 commit 52f5bf2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions server/portaluserdb/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
from datetime import timedelta
import configparser
from django.core.management.utils import get_random_secret_key
import logging #log the entire secrets dictionary to debug

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)


# Build paths inside the project like this: BASE_DIR / 'subdir'.
Expand Down Expand Up @@ -73,14 +70,15 @@
GOOGLE_CLIENT = secrets["GOOGLE_KEYS"]["DJANGO_GOOGLE_OAUTH2_CLIENT_ID"]
if secrets["GOOGLE_KEYS"]["DJANGO_GOOGLE_OAUTH2_CLIENT_SECRET"]:
GOOGLE_SECRET = secrets["GOOGLE_KEYS"]["DJANGO_GOOGLE_OAUTH2_CLIENT_SECRET"]

if secrets["SERVER"]["EMAIL_BACKEND"]:
EMAIL_BACKEND = secrets["SERVER"]["EMAIL_BACKEND"]
try:
EMAIL_BACKEND = secrets["SERVER"]["EMAIL_BACKEND"]
except KeyError:
raise KeyError("EMAIL_BACKEND not found in secrets")


logger.info(f"Secrets loaded: {secrets}")

# Use print statements for debugging
print(f"Secrets: {secrets}")
# SECURITY WARNING: don't run with debug turned on in production!
Expand Down

0 comments on commit 52f5bf2

Please sign in to comment.