sunscrapers/djet — pull request #4 by khalas (2013-11-22 09:44:28+00:00)
Title: Handle all middlewares methods - fixed issue #1

I don't like this code. I don't like this tests. I don't like documentation.

... but API is clean and it works like a charm. Any other ideas? Fell free to decline or discuss before merge.

The problem here is that we need to create middleware processing algorithm from scratch. It's defined here https://github.com/django/django/blob/e6dd70b4dba3b7d812fecda7288c9707990ea71b/django/core/handlers/base.py#L75 but this method is messed up with many other stuff (like url dispatching, template rendering, etc), so we can't reuse it. There is also `make_middleware_decorator` (https://github.com/django/django/blob/c3aa2948c6c14862407501290571f858ccf45b07/django/utils/decorators.py#L85) but probably it will be also hard to reuse.