Merge pull request #10 from nephila/feature/use_get_host
Use higher level functions to discover current host
This commit is contained in:
commit
35397dd4ff
1 changed files with 2 additions and 5 deletions
|
@ -10,11 +10,8 @@ from django.utils.six.moves import urllib_parse as urlparse
|
|||
class CMSMultiSiteMiddleware(object):
|
||||
def process_request(self, request):
|
||||
try:
|
||||
full_host = '{scheme}://{host}'.format(
|
||||
scheme=request.scheme, host=request.META['HTTP_HOST']
|
||||
)
|
||||
parsed = urlparse.urlparse(full_host)
|
||||
host = parsed.hostname
|
||||
parsed = urlparse.urlparse(request.build_absolute_uri())
|
||||
host = parsed.hostname.split(':')[0]
|
||||
urlconf = None
|
||||
try:
|
||||
urlconf = settings.MULTISITE_CMS_URLS[host]
|
||||
|
|
Loading…
Reference in a new issue