1👍
✅
Well, if it looks like a duck, and quacks like a duck…
But yes, your process_response()
method should receive a HttpResponse
subclass, not an exception. If your middleware receives an exception, it is most likely caused by returning a Http404
, instead of raising it, in the view or a previous middleware method.
👤knbk
Source:stackexchange.com