]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Introduce BASE_URL, make LOGIN_URL and STATIC_URL work with subpath
authorpuuu <puuu@users.noreply.github.com>
Fri, 14 May 2021 05:20:05 +0000 (14:20 +0900)
committerpuuu <puuu@users.noreply.github.com>
Fri, 14 May 2021 05:44:13 +0000 (14:44 +0900)
src/paperless/settings.py

index 26a4d562121cdd734972034c6f0e42e63967c89b..0e9ab53f3915346e5fea245306ca76e46e216bc0 100644 (file)
@@ -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 = [