[Django] #26601: DEP5 implementation: Improved middleware

20 views
Skip to first unread message

Django

unread,
May 9, 2016, 12:19:00 PM5/9/16
to django-...@googlegroups.com
#26601: DEP5 implementation: Improved middleware
-----------------------------------------+------------------------
Reporter: timgraham | Owner: nobody
Type: New feature | Status: new
Component: HTTP handling | Version: master
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
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.

[https://github.com/django/deps/blob/master/draft/0005-improved-
middleware.rst DEP]

[https://groups.google.com/d/topic/django-
developers/8LMJ44KAxWI/discussion django-developers discussion]

--
Ticket URL: <https://code.djangoproject.com/ticket/26601>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 9, 2016, 12:25:39 PM5/9/16
to django-...@googlegroups.com
#26601: DEP5 implementation: Improved middleware
-------------------------------+-------------------------------------
Reporter: timgraham | Owner: timgraham
Type: New feature | Status: assigned

Component: HTTP handling | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-------------------------------------
Changes (by timgraham):

* status: new => assigned
* owner: nobody => timgraham
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/6501 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/26601#comment:1>

Django

unread,
May 13, 2016, 5:27:42 PM5/13/16
to django-...@googlegroups.com
#26601: DEP5 implementation: Improved middleware
-------------------------------------+-------------------------------------

Reporter: timgraham | Owner: timgraham
Type: New feature | Status: assigned
Component: HTTP handling | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/26601#comment:2>

Django

unread,
May 17, 2016, 9:21:47 AM5/17/16
to django-...@googlegroups.com
#26601: DEP5 implementation: Improved middleware
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: timgraham
Type: New feature | Status: closed

Component: HTTP handling | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* status: assigned => closed
* resolution: => fixed


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/26601#comment:3>

Django

unread,
Jun 17, 2016, 3:55:57 PM6/17/16
to django-...@googlegroups.com
#26601: DEP5 implementation: Improved middleware
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: timgraham
Type: New feature | Status: closed
Component: HTTP handling | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carl Meyer <carl@…>):

In [changeset:"7d1b69dbe7f72ac04d2513f0468fe2146231b286" 7d1b69db]:
{{{
#!CommitTicketReference repository=""
revision="7d1b69dbe7f72ac04d2513f0468fe2146231b286"
Refs #26601 -- Improved backwards-compatibility of DEP 5 middleware
exception handling.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26601#comment:4>

Django

unread,
Jun 17, 2016, 3:56:22 PM6/17/16
to django-...@googlegroups.com
#26601: DEP5 implementation: Improved middleware
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: timgraham
Type: New feature | Status: closed
Component: HTTP handling | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"69de988f9237fe978c5fca363ca2d2622f8e2ccd" 69de988f]:
{{{
#!CommitTicketReference repository=""
revision="69de988f9237fe978c5fca363ca2d2622f8e2ccd"
[1.10.x] Refs #26601 -- Improved backwards-compatibility of DEP 5
middleware exception handling.

Backport of 7d1b69dbe7f72ac04d2513f0468fe2146231b286 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26601#comment:5>

Django

unread,
Jan 17, 2017, 10:09:53 PM1/17/17
to django-...@googlegroups.com
#26601: DEP5 implementation: Improved middleware
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Tim
| Graham

Type: New feature | Status: closed
Component: HTTP handling | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"d334f46b7a080fd3eb720141c19b37b10704a352" d334f46b]:
{{{
#!CommitTicketReference repository=""
revision="d334f46b7a080fd3eb720141c19b37b10704a352"
Refs #26601 -- Removed support for old-style middleware using
settings.MIDDLEWARE_CLASSES.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26601#comment:6>

Django

unread,
Jan 17, 2017, 10:09:53 PM1/17/17
to django-...@googlegroups.com
#26601: DEP5 implementation: Improved middleware
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Tim
| Graham
Type: New feature | Status: closed
Component: HTTP handling | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"6192bffb130132461e55e5fe7a7eaaa9a166d08f" 6192bff]:
{{{
#!CommitTicketReference repository=""
revision="6192bffb130132461e55e5fe7a7eaaa9a166d08f"
Refs #26601 -- Removed obsolete system check for MIDDLEWARE_CLASSES
setting.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26601#comment:7>

Django

unread,
Sep 24, 2019, 3:58:56 AM9/24/19
to django-...@googlegroups.com
#26601: DEP5 implementation: Improved middleware
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Tim
| Graham
Type: New feature | Status: closed
Component: HTTP handling | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"d71497bb249a2c3ffec41e99089f5ae8e575f2d3" d71497b]:
{{{
#!CommitTicketReference repository=""
revision="d71497bb249a2c3ffec41e99089f5ae8e575f2d3"
Refs #26601 -- Used new-style middlewares in documentation.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26601#comment:8>

Django

unread,
Sep 24, 2019, 4:00:10 AM9/24/19
to django-...@googlegroups.com
#26601: DEP5 implementation: Improved middleware
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Tim
| Graham
Type: New feature | Status: closed
Component: HTTP handling | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"1319124aa9b997cb73cc6e8097f9d34e771d1867" 1319124]:
{{{
#!CommitTicketReference repository=""
revision="1319124aa9b997cb73cc6e8097f9d34e771d1867"
[3.0.x] Refs #26601 -- Used new-style middlewares in documentation.

Backport of d71497bb249a2c3ffec41e99089f5ae8e575f2d3 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26601#comment:9>

Django

unread,
Sep 24, 2019, 4:00:42 AM9/24/19
to django-...@googlegroups.com
#26601: DEP5 implementation: Improved middleware
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Tim
| Graham
Type: New feature | Status: closed
Component: HTTP handling | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"29d2f5a66212af91f93edb47df07982f92b4ac5f" 29d2f5a6]:
{{{
#!CommitTicketReference repository=""
revision="29d2f5a66212af91f93edb47df07982f92b4ac5f"
[2.2.x] Refs #26601 -- Used new-style middlewares in documentation.

Backport of d71497bb249a2c3ffec41e99089f5ae8e575f2d3 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26601#comment:10>

Django

unread,
Oct 23, 2019, 2:53:12 AM10/23/19
to django-...@googlegroups.com
#26601: DEP5 implementation: Improved middleware
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Tim
| Graham
Type: New feature | Status: closed
Component: HTTP handling | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"0315c18fe170b1b611b7d10b5dde2f196b89a7e0" 0315c18f]:
{{{
#!CommitTicketReference repository=""
revision="0315c18fe170b1b611b7d10b5dde2f196b89a7e0"
Refs #26601 -- Removed obsolete workarounds for MIDDLEWARE_CLASSES
setting.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26601#comment:11>

Django

unread,
Feb 18, 2020, 2:03:57 PM2/18/20
to django-...@googlegroups.com
#26601: DEP5 implementation: Improved middleware
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Tim
| Graham
Type: New feature | Status: closed
Component: HTTP handling | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson <carlton@…>):

In [changeset:"4d973f593932285cd2f765400d915305d8e7333a" 4d973f59]:
{{{
#!CommitTicketReference repository=""
revision="4d973f593932285cd2f765400d915305d8e7333a"
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...@noumenal.es>
Co-authored-by: Mariusz Felisiak <felisiak...@gmail.com>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26601#comment:12>

Django

unread,
Aug 28, 2020, 7:32:00 AM8/28/20
to django-...@googlegroups.com
#26601: DEP5 implementation: Improved middleware
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Tim
| Graham
Type: New feature | Status: closed
Component: HTTP handling | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"68d7cf4054e4d53d77270659113520540cc7cadc" 68d7cf4]:
{{{
#!CommitTicketReference repository=""
revision="68d7cf4054e4d53d77270659113520540cc7cadc"
Refs #26601 -- Added various middlewares tests for deprecation of passing
None as get_response.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26601#comment:13>

Django

unread,
Jan 14, 2021, 2:12:18 PM1/14/21
to django-...@googlegroups.com
#26601: DEP5 implementation: Improved middleware
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Tim
| Graham
Type: New feature | Status: closed
Component: HTTP handling | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"4bb30fe5d598a7acd2a3055c5e66224cf42a75e9" 4bb30fe5]:
{{{
#!CommitTicketReference repository=""
revision="4bb30fe5d598a7acd2a3055c5e66224cf42a75e9"
Refs #26601 -- Made get_response argument required and don't accept None
in middleware classes.

Per deprecation timeline.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26601#comment:14>

Reply all
Reply to author
Forward
0 new messages