Skip to content

Commit

Permalink
fix: correct BASE_DIR vs path for .env file to get dotenv working as …
Browse files Browse the repository at this point in the history
…expected
  • Loading branch information
Adrian McPhee committed Oct 2, 2024
1 parent a439bfe commit 0a92b33
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions apps/openunited/settings/base.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import os
from dotenv import load_dotenv
from pathlib import Path

import sentry_sdk
from dotenv import load_dotenv

DEBUG = True

# Build paths inside the project like this: BASE_DIR / 'subdir'.
# BASE_DIR should point to the platform directory
BASE_DIR = Path(__file__).resolve().parent.parent.parent
load_dotenv(os.path.join(BASE_DIR, ".env"))

# Path to the .env file
dotenv_path = os.path.join(BASE_DIR.parent, ".env")

# Load .env file
load_dotenv(dotenv_path)


ALLOWED_HOSTS = []
if allowed_hosts := os.environ.get("DJANGO_ALLOWED_HOSTS"):
Expand Down

0 comments on commit 0a92b33

Please sign in to comment.