'Return an HttpResponse object for the given HttpRequest.'

def get_response(self, request):

    set_urlconf(settings.ROOT_URLCONF)
    response = self._middleware_chain(request)
    response._closable_objects.append(request)
    if ((not getattr(response, 'is_rendered', True)) and callable(getattr(response, 'render', None))):
        response = response.render()
    if (response.status_code == 404):
        logger.warning('Not    Found:    %s', request.path, extra={'status_code': 404, 'request': request})
    return response
