[Django] #37037: decorator_from_middleware() docs contain stale reference to Django 1.9

3 views
Skip to first unread message

Django

unread,
Apr 15, 2026, 7:42:11 PM (2 days ago) Apr 15
to django-...@googlegroups.com
#37037: decorator_from_middleware() docs contain stale reference to Django 1.9
-------------------------------------+-------------------------------------
Reporter: EoinShaughs | Type:
| Cleanup/optimization
Status: new | Component:
| Documentation
Version: 6.0 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
The docstring for decorator_from_middleware() in docs/ref/utils.txt states
it "assumes middleware that's compatible with the old style of Django 1.9
and earlier", which is misleading. MIDDLEWARE_CLASSES was removed in
Django 2.0, and the function works with any middleware implementing the
standard hook methods. The source code docstring in
django/utils/decorators.py contains no such restriction.
--
Ticket URL: <https://code.djangoproject.com/ticket/37037>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 15, 2026, 7:50:38 PM (2 days ago) Apr 15
to django-...@googlegroups.com
#37037: decorator_from_middleware() docs contain stale reference to Django 1.9
-------------------------------------+-------------------------------------
Reporter: EoinShaughs | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by EoinShaughs):

* has_patch: 0 => 1

Comment:

https://github.com/django/django/pull/21109
--
Ticket URL: <https://code.djangoproject.com/ticket/37037#comment:1>

Django

unread,
Apr 15, 2026, 9:09:01 PM (2 days ago) Apr 15
to django-...@googlegroups.com
#37037: decorator_from_middleware() docs contain stale reference to Django 1.9
-------------------------------------+-------------------------------------
Reporter: EoinShaughs | Owner: (none)
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 6.0
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* resolution: => invalid
* status: new => closed

Comment:

I wouldn't call `process_request()`, etc. "standard hook methods" as your
PR proposes because these method don't work unless you use
`django.utils.deprecation.MiddlewareMixin`. There is still a section
regarding [https://docs.djangoproject.com/en/dev/topics/http/middleware
/#upgrading-pre-django-1-10-style-middleware upgrading pre-Django
1.10-style middleware], so IMO, the version reference isn't stale.
--
Ticket URL: <https://code.djangoproject.com/ticket/37037#comment:2>
Reply all
Reply to author
Forward
0 new messages