Skip to content
This repository has been archived by the owner on Jan 5, 2025. It is now read-only.

Commit

Permalink
Merge pull request #164 from lvalics/patch-2
Browse files Browse the repository at this point in the history
Update settings.py
  • Loading branch information
gharbat authored Oct 19, 2023
2 parents 8b73fd4 + ff71a87 commit dc27b1d
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions dj_backend_server/dj_backend_server/settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
from dotenv import load_dotenv
load_dotenv()
import os
from os import path
from dotenv import load_dotenv,find_dotenv

# Get the parent directory of the Django project
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Search for the .env.docker file in the parent directory
dotenv_path = find_dotenv('.env.docker', os.path.join(BASE_DIR, '..'))
load_dotenv(dotenv_path)

"""
Django settings for dj_backend_server project.
Expand Down Expand Up @@ -172,7 +179,9 @@

SESSION_ENGINE = 'django.contrib.sessions.backends.db' # You can choose other engines as well

ALLOWED_HOSTS = [
'localhost',
'0.0.0.0',
]
#ALLOWED_HOSTS = [
# 'localhost',
# '0.0.0.0',
#]
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '0.0.0.0').split(',')
APP_URL = os.environ.get('APP_URL', 'http://localhost:8000')

0 comments on commit dc27b1d

Please sign in to comment.