From 72af13e4e4fb9e759b938cd0cc2b19ac34dd1a27 Mon Sep 17 00:00:00 2001 From: Daniel Quinn Date: Fri, 13 Apr 2018 20:18:00 +0100 Subject: [PATCH] Allow STATIC_URL and MEDIA_URL to be configurable via env --- paperless.conf.example | 9 +++++++++ src/paperless/settings.py | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/paperless.conf.example b/paperless.conf.example index d6d6527f0..45c532fe1 100644 --- a/paperless.conf.example +++ b/paperless.conf.example @@ -29,6 +29,15 @@ PAPERLESS_CONSUMPTION_DIR="" #PAPERLESS_STATICDIR="" +# Override the MEDIA_URL here. Unless you're hosting Paperless off a subdomain +# like /paperless/, you probably don't need to change this. +#PAPERLESS_MEDIA_URL="/media/" + +# Override the STATIC_URL here. Unless you're hosting Paperless off a +# subdomain like /paperless/, you probably don't need to change this. +#PAPERLESS_STATIC_URL="/static/" + + # These values are required if you want paperless to check a particular email # box every 10 minutes and attempt to consume documents from there. If you # don't define a HOST, mail checking will just be disabled. diff --git a/src/paperless/settings.py b/src/paperless/settings.py index 1dab5dd4a..314edeb03 100644 --- a/src/paperless/settings.py +++ b/src/paperless/settings.py @@ -185,8 +185,8 @@ STATIC_ROOT = os.getenv( MEDIA_ROOT = os.getenv( "PAPERLESS_MEDIADIR", os.path.join(BASE_DIR, "..", "media")) -STATIC_URL = '/static/' -MEDIA_URL = "/media/" +STATIC_URL = os.getenv("PAPERLESS_STATIC_URL", "/static/") +MEDIA_URL = os.getenv("PAPERLESS_MEDIA_URL", "/media/") # Paperless-specific stuff