From e792a00febae0f046f7de0c96aea3634434ccb3a Mon Sep 17 00:00:00 2001 From: puuu Date: Fri, 14 May 2021 14:20:05 +0900 Subject: [PATCH] Introduce BASE_URL, make LOGIN_URL and STATIC_URL work with subpath --- src/paperless/settings.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/paperless/settings.py b/src/paperless/settings.py index 26a4d5621..0e9ab53f3 100644 --- a/src/paperless/settings.py +++ b/src/paperless/settings.py @@ -142,11 +142,13 @@ MIDDLEWARE = [ ROOT_URLCONF = 'paperless.urls' FORCE_SCRIPT_NAME = os.getenv("PAPERLESS_FORCE_SCRIPT_NAME") +BASE_URL = (FORCE_SCRIPT_NAME or "") + "/" +LOGIN_URL = BASE_URL + "accounts/login/" WSGI_APPLICATION = 'paperless.wsgi.application' ASGI_APPLICATION = "paperless.asgi.application" -STATIC_URL = os.getenv("PAPERLESS_STATIC_URL", "/static/") +STATIC_URL = os.getenv("PAPERLESS_STATIC_URL", "static/") # TODO: what is this used for? TEMPLATES = [