Skip to content

Commit

Permalink
Merge pull request #669 from Health-Informatics-UoN/fix/640-updatre-d…
Browse files Browse the repository at this point in the history
…jango

Fix CSRF error on login
  • Loading branch information
AndyRae authored Apr 9, 2024
2 parents 7b40a03 + 5f83a66 commit 8eb3d4c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/api/api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
ALLOWED_HOSTS = [
x.strip()[1:-1] for x in os.environ.get("ALLOWED_HOSTS")[1:-1].split(",")
]
SECURE_SSL_REDIRECT = True
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")


# Application definition
Expand Down
2 changes: 1 addition & 1 deletion app/api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ build-backend = "poetry.core.masonry.api"
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra -q"
DJANGO_SETTINGS_MODULE = "api.settings"
DJANGO_SETTINGS_MODULE = "test.settings"
3 changes: 3 additions & 0 deletions app/api/test/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from api.settings import *

SECURE_SSL_REDIRECT = False

0 comments on commit 8eb3d4c

Please sign in to comment.