Let's say I have a view:
def pony_view(request, arg1, arg2):
... Make ponies, etc ...
And a middleware:
class MyMiddleware(object):
def process_request(request):
# How do I access arg1, arg2 here?
Of course arg1, and arg2 will be passed in via URL params with urls.py.
The reason I need to do this is because I want to add something to request.session before the view function runs (something that I need from the URL though).
process_view
is called, because I need to stop processing other middlewares in the chain given some condition that depends on a flag stored in the view. Is this possible? – Tatyanatau