From 1eb7582e6a291f2c5b3a30c408cb50f199fa6eac Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Mon, 27 Nov 2017 16:20:24 -0500 Subject: Add snippets to the home page from the configuration file --- app/dispatch/context_processors.py | 10 ++++++++++ app/dispatch/templates/dispatch/base.html | 4 ++-- app/dispatch/templates/dispatch/login.html | 21 +++++++++++++++++++-- 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 app/dispatch/context_processors.py (limited to 'app/dispatch') diff --git a/app/dispatch/context_processors.py b/app/dispatch/context_processors.py new file mode 100644 index 0000000..d6d50d5 --- /dev/null +++ b/app/dispatch/context_processors.py @@ -0,0 +1,10 @@ +from django.conf import settings + + +def additional_template_vars(request): + """ + A neat little hack to load up + additional variables into templates directly into the templates + """ + return {"template_vars": settings.TEMPLATE_VARS} + diff --git a/app/dispatch/templates/dispatch/base.html b/app/dispatch/templates/dispatch/base.html index efc9eb3..cac1b18 100644 --- a/app/dispatch/templates/dispatch/base.html +++ b/app/dispatch/templates/dispatch/base.html @@ -4,7 +4,7 @@ - {% block title %}{% endblock %} + {% block title %}{{template_vars.app_name}}{% endblock %} @@ -34,7 +34,7 @@