Skip to content

Commit

Permalink
Update ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS in settings.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean28518 committed May 7, 2024
1 parent eb2c43f commit 1bf0410
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lac/lac/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@
_words = line.split(" ")
for i in range(len(_words)):
if "portal." in _words[i]:
ALLOWED_HOSTS.append(_words[i].replace(";", ""))
CSRF_TRUSTED_ORIGINS.append(f"https://{_words[i].replace(";", "")}")
domain = _words[i].replace(";", "")
ALLOWED_HOSTS.append(domain)
CSRF_TRUSTED_ORIGINS.append(f"https://{domain}")
# Add all hosts from the environment variable separated by a comma
_hosts = os.getenv("ALLOWED_HOSTS", "").split(",")
for host in _hosts:
Expand Down

0 comments on commit 1bf0410

Please sign in to comment.