def __call__(self, request, *args, **kwargs): try: response = self.dispatch(request, self, *args, **kwargs) log_request(request, response, 'access') return response except (HttpMethodNotAllowed, Http403): log_request(request, None, 'access') response = HttpResponseNotAllowed(self.permitted_methods) response.mimetype = self.mimetype return response except TracedServerError, e: log_request(request, None, 'access') msg = log_detailed_exception(request, e)