Redirect middleware is a very good idea, but it's usage is quite narrow. It would be good to use more generic approach, with richer exception hierarchy, which would allow to handle other response types.
Sample use case:
you use CBV
you check a condition in .get_context(), which is important to any furtner processing in the view,
condition is not met and all processing should be halted, client should receive some 4xx response
without such infrastructure, get_context should return dictionary, which should be processed by view, which should check the dict and return error response.
with such infrastructure you can raise proper exception and handle it the middleware whithout boilerplate code in the view.
Redirect middleware is a very good idea, but it's usage is quite narrow. It would be good to use more generic approach, with richer exception hierarchy, which would allow to handle other response types.
Sample use case: