Opened 9 years ago

Closed 9 years ago

Last modified 4 years ago

#26601 closed New feature (fixed)

DEP5 implementation: Improved middleware

Reported by: Tim Graham Owned by: Tim Graham
Component: HTTP handling Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The existing Django "middleware" abstraction suffers from a lack of strict layering and balanced in/out calls to a given middleware. This DEP proposes an improved abstraction for wrapping the request cycle in layered pre-view and post-view actions.

DEP

django-developers discussion

Change History (14)

comment:1 by Tim Graham, 9 years ago

Has patch: set
Owner: changed from nobody to Tim Graham
Status: newassigned

comment:2 by Tim Graham, 9 years ago

Triage Stage: AcceptedReady for checkin

Got an LGTM from Carl; awaiting technical board approval of the DEP.

comment:3 by Tim Graham, 9 years ago

Resolution: fixed
Status: assignedclosed

In 05c888ffb843ba3eff06cd07b3cef5bbb513a54f:

Refs #26601 -- Refactored BaseHandler to prepare for new-style middleware.

In 9baf692a58de78dba13aa582098781675367c329:

Fixed #26601 -- Improved middleware per DEP 0005.

In ece4d24f8e494129c098868fa792400937941fab:

Refs #26601 -- Deprecated old-style middleware.

In 354acd04af524ad82002b903df1189581c51cabe:

Refs #26601 -- Added a warning if both MIDDLEWARE AND MIDDLEWARE_CLASSES are set.

comment:4 by Carl Meyer <carl@…>, 9 years ago

In 7d1b69db:

Refs #26601 -- Improved backwards-compatibility of DEP 5 middleware exception handling.

comment:5 by Tim Graham <timograham@…>, 9 years ago

In 69de988f:

[1.10.x] Refs #26601 -- Improved backwards-compatibility of DEP 5 middleware exception handling.

Backport of 7d1b69dbe7f72ac04d2513f0468fe2146231b286 from master

comment:6 by Tim Graham <timograham@…>, 8 years ago

In d334f46b:

Refs #26601 -- Removed support for old-style middleware using settings.MIDDLEWARE_CLASSES.

comment:7 by Tim Graham <timograham@…>, 8 years ago

In 6192bff:

Refs #26601 -- Removed obsolete system check for MIDDLEWARE_CLASSES setting.

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In d71497b:

Refs #26601 -- Used new-style middlewares in documentation.

comment:9 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In 1319124:

[3.0.x] Refs #26601 -- Used new-style middlewares in documentation.

Backport of d71497bb249a2c3ffec41e99089f5ae8e575f2d3 from master

comment:10 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In 29d2f5a6:

[2.2.x] Refs #26601 -- Used new-style middlewares in documentation.

Backport of d71497bb249a2c3ffec41e99089f5ae8e575f2d3 from master

comment:11 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In 0315c18f:

Refs #26601 -- Removed obsolete workarounds for MIDDLEWARE_CLASSES setting.

comment:12 by Carlton Gibson <carlton@…>, 5 years ago

In 4d973f59:

Refs #26601 -- Deprecated passing None as get_response arg to middleware classes.

This is the new contract since middleware refactoring in Django 1.10.

Co-authored-by: Carlton Gibson <carlton.gibson@…>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@…>

comment:13 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

In 68d7cf4:

Refs #26601 -- Added various middlewares tests for deprecation of passing None as get_response.

comment:14 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

In 4bb30fe5:

Refs #26601 -- Made get_response argument required and don't accept None in middleware classes.

Per deprecation timeline.

Note: See TracTickets for help on using tickets.
Back to Top