Chapter 19. Implementing Middleware
What You’ll Learn in This Hour
- How to install middleware applications
- How to use middleware applications
- How to implement a request preprocessor
- How to implement a view preprocessor
- How to implement a response postprocessor
- How to implement an exception postprocessor
- What built-in middleware comes with Django
So far, all the code that we have written to manipulate views has been in the view functions and templates. Django provides a simple-to-use framework, called middleware, that allows you to manipulate the behavior of views at the request and response level.
Using the middleware framework, you can write your own custom functions that hook into the request and response engine. These custom functions can be ...
Get Sams Teach Yourself Django in 24 Hours now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.