diff options
Diffstat (limited to 'src/meetingtools')
-rw-r--r-- | src/meetingtools/context_processors.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/meetingtools/context_processors.py b/src/meetingtools/context_processors.py new file mode 100644 index 0000000..5bd5885 --- /dev/null +++ b/src/meetingtools/context_processors.py @@ -0,0 +1,23 @@ +from django.core.exceptions import ImproperlyConfigured + +__author__ = 'leifj' + +from django.conf import settings +import logging + +def theme(request): + + def _w(x): + return {'theme': x} + + vhost = request.get_host() + vhost = vhost.replace(':','_') + + ctx = {'vhost': vhost} + if hasattr(settings,'THEMES'): + if settings.THEMES.has_key(vhost): + ctx.update(settings.THEMES[vhost]) + elif settings.THEMES.has_key('__default__'): + ctx.update(settings.THEMES['__default__']) + + return _w(ctx) |