twoscoops / two-scoops-of-django-1.8

Tracking thoughts and feature requests for Two Scoops of Django 1.8 in the issue tracker. And the book's code examples are here.
400 stars 81 forks source link

1.8 -> Example 22.4 -> add_middleware_to_response is receiving a request #128

Closed jgomo3 closed 7 years ago

jgomo3 commented 8 years ago

It should receive and process a response.

The example is:

def add_middleware_to_response(request, middleware_class):
    middleware = middleware_class()
    middleware.process_request(request)

And should be:

def add_middleware_to_response(response middleware_class):
    middleware = middleware_class()
    middleware.process_response(response)

Note that the middleware method change also, from process_request to process_response

pydanny commented 7 years ago

🚢 :shipit: