def process_response(self, request, response): if isinstance(response, HttpResponseForbidden): return handle403(request) # If not 403, return response unmodified return response