diff --git a/app/api/api/settings.py b/app/api/api/settings.py index 7f30aff4a..5d03f3f52 100644 --- a/app/api/api/settings.py +++ b/app/api/api/settings.py @@ -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 diff --git a/app/api/pyproject.toml b/app/api/pyproject.toml index a39f6d9f9..f576476ea 100644 --- a/app/api/pyproject.toml +++ b/app/api/pyproject.toml @@ -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" diff --git a/app/api/test/settings.py b/app/api/test/settings.py new file mode 100644 index 000000000..9cc1d8ca2 --- /dev/null +++ b/app/api/test/settings.py @@ -0,0 +1,3 @@ +from api.settings import * + +SECURE_SSL_REDIRECT = False