diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-03-27 14:54:10 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-03-27 14:54:10 -0400 |
commit | 3c115c85cf8cea1d7083c2643043d556a4992131 (patch) | |
tree | b05e47e732746eaff8d124b9f3b0bc920ddff38f | |
parent | 63caf646fa72121852eeb4944b6b9ce606665ba0 (diff) |
Add a context processor so BRANDING_* works in templaces
-rw-r--r-- | main/context_processors.py | 9 | ||||
-rw-r--r-- | settings.py | 11 |
2 files changed, 15 insertions, 5 deletions
diff --git a/main/context_processors.py b/main/context_processors.py index a60d4e63..850bb499 100644 --- a/main/context_processors.py +++ b/main/context_processors.py @@ -1,4 +1,13 @@ def secure(request): return {'secure': request.is_secure()} +def branding(request): + from django.conf import settings + return { + 'BRANDING_APPNAME': settings.BRANDING_APPNAME, + 'BRANDING_DISTRONAME': settings.BRANDING_DISTRONAME, + 'BRANDING_SHORTNAME': settings.BRANDING_SHORTNAME, + 'BRANDING_EMAIL': settings.BRANDING_EMAIL, + } + # vim: set ts=4 sw=4 et: diff --git a/settings.py b/settings.py index 998eefbd..c979d03f 100644 --- a/settings.py +++ b/settings.py @@ -54,6 +54,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.static', 'django.contrib.messages.context_processors.messages', 'main.context_processors.secure', + 'main.context_processors.branding', ) TEMPLATE_DIRS = ( @@ -138,6 +139,11 @@ PXEBOOT_URL = 'http://releng.archlinux.org/pxeboot/' # community bit on the end, repo.svn_root is appended) SVN_BASE_URL = 'svn://svn.archlinux.org/' +BRANDING_APPNAME = 'archweb' +BRANDING_DISTRONAME = 'Arch Linux' +BRANDING_SHORTNAME = 'Arch' +BRANDING_EMAIL = 'Arch Website Notification <nobody@archlinux.org>' + ## Import local settings from local_settings import * @@ -156,8 +162,3 @@ if DEBUG_TOOLBAR: INSTALLED_APPS = list(INSTALLED_APPS) + [ 'debug_toolbar' ] # vim: set ts=4 sw=4 et: - -BRANDING_APPNAME = 'archweb' -BRANDING_DISTRONAME = 'Arch Linux' -BRANDING_SHORTNAME = 'Arch' -BRANDING_EMAIL = 'Arch Website Notification <nobody@archlinux.org>' |