From a0cddae1c7a86d160b444daa80522ab9cd98ac2c Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 13 Apr 2020 10:42:21 +0100 Subject: [PATCH] Inject settings into template context --- website/common/context_processors.py | 5 +++++ website/settings.py | 1 + 2 files changed, 6 insertions(+) create mode 100644 website/common/context_processors.py diff --git a/website/common/context_processors.py b/website/common/context_processors.py new file mode 100644 index 0000000..1a6a517 --- /dev/null +++ b/website/common/context_processors.py @@ -0,0 +1,5 @@ +from django.conf import settings + + +def settings_injector(request=None): + return {"settings": settings} diff --git a/website/settings.py b/website/settings.py index 22d9bf5..b06eeda 100644 --- a/website/settings.py +++ b/website/settings.py @@ -61,6 +61,7 @@ TEMPLATES = [ "context_processors": [ "django.template.context_processors.debug", "django.template.context_processors.request", + "website.common.context_processors.settings_injector", ], }, },