Skip to content

Commit

Permalink
fix: Update ALLOWED_HOSTS to allow all hosts and simplify STATIC_ROOT…
Browse files Browse the repository at this point in the history
… configuration
  • Loading branch information
AhmedNassar7 committed Dec 25, 2024
1 parent 01663b8 commit 9879103
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions egypt_metro/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.getenv("SECRET_KEY") # Secret key for Django
DEBUG = os.getenv("DEBUG", "False") == "True" # Default to False
# DEBUG = os.getenv("DEBUG", "False") == "True" # Default to False
# ALLOWED_HOSTS = config("ALLOWED_HOSTS", default="").split(",")
ALLOWED_HOSTS = ['backend-54v5.onrender.com', '127.0.0.1', 'localhost']
DEBUG = True
ALLOWED_HOSTS = ['*']
BASE_URL = os.getenv("BASE_URL") # Base URL for the project
JWT_SECRET = os.getenv("JWT_SECRET") # Secret key for JWT tokens
CSRF_TRUSTED_ORIGINS = ["https://backend-54v5.onrender.com"]
Expand Down Expand Up @@ -359,10 +360,7 @@

STATIC_URL = "/static/" # URL for static files

if os.getenv("RENDER"):
STATIC_ROOT = "/opt/render/project/src/staticfiles/"
else:
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') # Folder where static files will be collected
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') # Folder where static files will be collected

STATICFILES_STORAGE = (
"whitenoise.storage.CompressedManifestStaticFilesStorage" # Static files storage
Expand Down

0 comments on commit 9879103

Please sign in to comment.