From e6781d9dbcb76b7c17205f0e08629f17214363f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Oddsson?= Date: Thu, 9 Mar 2017 11:10:50 +0000 Subject: [PATCH] Expose `base_url` in global context for templates Since `DPASTE_BASE_URL` is a dynamic setting that can be changed when the application is self-hosted, the templates need to have access to the variable when rendering the templates so that they do not erroneously display the dpaste.de url. --- dpaste/context_processors.py | 1 + 1 file changed, 1 insertion(+) diff --git a/dpaste/context_processors.py b/dpaste/context_processors.py index f4dbefa..ee72c7f 100644 --- a/dpaste/context_processors.py +++ b/dpaste/context_processors.py @@ -2,6 +2,7 @@ from django.conf import settings def dpaste_globals(request): return { + 'base_url': getattr(settings, 'DPASTE_BASE_URL', 'https://dpaste.de'), 'site_name': getattr(settings, 'DPASTE_SITE_NAME', 'dpaste.de'), 'jquery_url': getattr(settings, 'DPASTE_JQUERY_URL', 'https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js'),