blob: 5bd58857c41e16181f8113c13ea15feee314f5d9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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)
|