In Django, middleware is code that processes a user’s request at various points in the request-response cycle (this is the Chain of Responsibility pattern). They are hooks that can modify the request as needed before the view handlers it, check cookies, log information, etc.

These are different from Django Context Processors because the processors simply set a context - a dictionary of items that is merged into the context of the response. Middlewares, on the other hand, can be thought of as code that intercepts and manipulates the request and responses themselves.