I have an a django app for which I am writing middleware for. In the middleware, I have process_exception
function where I have a the request
object which is a WSGI Request
object.
I want to get the view that the request has passed through. How can I do that?
If I try request.view
, I get:
AttributeError: 'WSGIRequest' object has no attribute 'view'
I would further like to get model, serializer being used in that view but ofcourse I can do that using getattr
easily once I get the view.