From a1c6bc29e9572a55f28a3d40dd706dfecacd4e28 Mon Sep 17 00:00:00 2001 From: Dominik George <dominik.george@teckids.org> Date: Mon, 27 Feb 2023 15:26:48 +0100 Subject: [PATCH] Fix base URL in production if not configured --- CHANGELOG.rst | 2 ++ aleksis/core/settings.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index cc8384d50..d7c43f0e7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -33,6 +33,8 @@ Removed * Official support for views rendered server-side in Django is removed. The `LegacyBaseTemplate` provided for backwards compatibility must not be used by apps declaring a dependency on AlekSIS >= 3.0. +* Support for deploying AlekSIS in sub-URLs +* Support for production deployments without HTTPS Deprecated ~~~~~~~~~~ diff --git a/aleksis/core/settings.py b/aleksis/core/settings.py index c12ae3371..060328efd 100644 --- a/aleksis/core/settings.py +++ b/aleksis/core/settings.py @@ -68,7 +68,8 @@ DJANGO_VITE_DEV_SERVER_PORT = DEV_SERVER_PORT + 1 ALLOWED_HOSTS = _settings.get("http.allowed_hosts", [getfqdn(), "localhost", "127.0.0.1", "[::1]"]) BASE_URL = _settings.get( - "http.base_url", f"http://localhost:{DEV_SERVER_PORT}" if DEBUG else f"//{ALLOWED_HOSTS[0]}" + "http.base_url", + f"http://localhost:{DEV_SERVER_PORT}" if DEBUG else f"https://{ALLOWED_HOSTS[0]}", ) -- GitLab