Opened 4 weeks ago

Closed 3 weeks ago

#36994 closed Uncategorized (wontfix)

Middleware hooks working on functional middleware is not documented

Reported by: Aarni Koskela Owned by: Aarni Koskela
Component: Core (Other) Version: 6.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Middleware hooks like process_exception, process_template_response, process_view factually work on function middleware (though process_template_response requires a gentle adjustment to how middleware name is computed).

This is undocumented behavior, so it would probably be best to codify it in documentation.

Change History (3)

comment:2 by Tim McCurrach, 4 weeks ago

I'm not aware of this being a duplicate ticket, but it does appear to be a duplicate of these existing PRs:
https://github.com/django/django/pull/19856
https://github.com/django/django/pull/19857

My tuppence worth is that it's kind of an implementation detail that the hooks happen to work with function-based middleware. Whilst I don't have much objection to documenting them (and so officially supporting them), I really can't imagine a scenario where I would ever want to write middleware by decorating a function with these hooks. Maybe there is a use-case though??

comment:3 by Natalia Bidart, 3 weeks ago

Resolution: wontfix
Status: assignedclosed

I agree with Tim that there is no gain in documenting this nor a necessary commitment to ensure this works in the long term. Closing accordingly.

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