Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion backend/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

current_directory_path = os.path.dirname(os.path.abspath(__file__))


if DJANGO_ENV == "prod":
load_dotenv(os.path.join(current_directory_path, "../env/.env.prod"))
else:
Expand All @@ -37,6 +36,8 @@
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.getenv("SECRET_KEY")

DJANGO_ALLOWED_HOSTS = os.getenv("DJANGO_ALLOWED_HOSTS", "")

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = DJANGO_ENV == "dev"

Expand All @@ -52,6 +53,9 @@
"127.0.0.1",
]

if DJANGO_ALLOWED_HOSTS:
ALLOWED_HOSTS.extend(DJANGO_ALLOWED_HOSTS.split(","))

CORS_ALLOWED_ORIGINS = [
"http://127.0.0.1:5173",
"http://localhost:5173",
Expand Down
3 changes: 2 additions & 1 deletion backend/env/.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ POSTGRES_USERNAME = postgres
POSTGRES_PASSWORD = postgres
POSTGRES_DATABASE = bwwc
MONGO_HOST = mongo
MONGO_PORT = 27017
MONGO_PORT = 27017
DJANGO_ALLOWED_HOSTS = ""
3 changes: 2 additions & 1 deletion backend/env/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ POSTGRES_USERNAME = postgres
POSTGRES_PASSWORD = postgres
POSTGRES_DATABASE = bwwc
MONGO_HOST = localhost
MONGO_PORT = 27017
MONGO_PORT = 27017
DJANGO_ALLOWED_HOSTS = ""
Loading