Redirection + 403 error
I am searching for a way to have something like that : return HttpResponseForbiddenRedirect(reverse("view_name")) an HttpResponse which redirect to a view (with its name) but still throw a 403 error I tried to do something like that : class HttpResponseForbiddenRedirect(HttpResponse): def __init__(self, redirect_to): super(HttpResponseForbiddenRedirect, self).__init__() self['Location'] = iri_to_uri(redirect_to) self.status_code = 403 But it didn't work. For some reason I don't understand, I don't get any content It doesn't work because you can't have a 403 response that is also acted upon as