0001-context-processor-for-appending-tenant-name-in-stati.patch
entrouvert/djommon/multitenant/context_processors.py | ||
---|---|---|
1 |
from django.conf import settings |
|
2 |
from tenant_schemas.utils import remove_www_and_dev |
|
3 | ||
4 |
def static(request): |
|
5 |
""" |
|
6 |
Add tenant dependend static context variable to the context |
|
7 |
""" |
|
8 |
try: |
|
9 |
static_url = settings.STATIC_URL |
|
10 |
except AttributeError: |
|
11 |
raise ImproperlyConfigured('STATIC_URL must be defined') |
|
12 | ||
13 |
return {'STATIC_URL': '%s/%s' % (static_url, |
|
14 |
remove_www_and_dev(request.get_host().split(':')[0]))} |
|
0 |
- |