Changes between Version 7 and Version 8 of MultiHostMiddleware


Ignore:
Timestamp:
Oct 12, 2015, 6:09:24 AM (9 years ago)
Author:
Artem Ulko
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MultiHostMiddleware

    v7 v8  
    5656                host = host_port[0]
    5757
    58             if settings.HOST_MIDDLEWARE_URLCONF_MAP.has_key(host):
     58            if host in settings.HOST_MIDDLEWARE_URLCONF_MAP:
    5959                request.urlconf = settings.HOST_MIDDLEWARE_URLCONF_MAP[host]
    6060                request.META["MultiHost"] = str(request.urlconf)
     
    6666
    6767    def process_response(self, request, response):
    68         if request.META.has_key('MultiHost'):
     68        if 'MultiHost' in request.META:
    6969            response['MultiHost'] = request.META.get("MultiHost")
    7070
    71         if request.META.has_key('LoadingStart'):
     71        if 'LoadingStart' in request.META:
    7272            _loading_time = time.time() - int(request.META["LoadingStart"])
    7373            response['LoadingTime'] = "%.2fs" % ( _loading_time, )
Back to Top