Changes between Version 7 and Version 8 of MultiHostMiddleware
- Timestamp:
- Oct 12, 2015, 6:09:24 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MultiHostMiddleware
v7 v8 56 56 host = host_port[0] 57 57 58 if settings.HOST_MIDDLEWARE_URLCONF_MAP.has_key(host):58 if host in settings.HOST_MIDDLEWARE_URLCONF_MAP: 59 59 request.urlconf = settings.HOST_MIDDLEWARE_URLCONF_MAP[host] 60 60 request.META["MultiHost"] = str(request.urlconf) … … 66 66 67 67 def process_response(self, request, response): 68 if request.META.has_key('MultiHost'):68 if 'MultiHost' in request.META: 69 69 response['MultiHost'] = request.META.get("MultiHost") 70 70 71 if request.META.has_key('LoadingStart'):71 if 'LoadingStart' in request.META: 72 72 _loading_time = time.time() - int(request.META["LoadingStart"]) 73 73 response['LoadingTime'] = "%.2fs" % ( _loading_time, )