Changes between Version 4 and Version 5 of MultiHostMiddleware
- Timestamp:
- Feb 19, 2013, 1:00:39 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MultiHostMiddleware
v4 v5 47 47 request.META["LoadingStart"] = time.time() 48 48 host = request.META["HTTP_HOST"] 49 if host[-3:] == ":80": 50 host = host[:-3] # ignore default port number, if present 49 #if host[-3:] == ":80": 50 # host = host[:-3] # ignore default port number, if present 51 52 # best way to do this. 53 host = request.META["HTTP_HOST"] 54 host_port = host.split(':') 55 56 if len(host_port)==2: 57 host = host_port[0] 58 51 59 if settings.HOST_MIDDLEWARE_URLCONF_MAP.has_key(host): 52 60 request.urlconf = settings.HOST_MIDDLEWARE_URLCONF_MAP[host]