On 5/16/18 10:49 AM, Florian Apolloner wrote:
> Hi Carl,
> 
> On Wednesday, May 16, 2018 at 5:58:02 AM UTC+2, Carl Meyer wrote:
> 
>     I'm not sure this part is feasible. It's an intentional part of
>     middleware design AFAIK (and useful) that middleware can modify
>     request.path and have this modification respected in view resolution.
> 
> 
> my proposed urlresolver_factory takes the request as argument and should
> therefore allow for anything that the middleware would allow too -- are
> there any specific usecases you have in mind that would require a
> middleware?

Composing two different middleware that both alter request.path for
different purposes? This will require the site owner to manually compose
in their urlconf_factory.

I think your core proposal that the main middleware call layering should
run after view resolution instead of before it is probably a better
design for middleware in principle, but it needs work in a couple areas:

1. Motivating the change in a way that clarifies how it will benefit
typical Django users, sufficiently to justify the churn. What new
possibilities are unlocked by the change, and has there been demand for
those possibilities?
2. Fleshing out how a reasonable transition path for existing middleware
(including third-party middleware) would look.

It's too bad we didn't think about this possibility during the original
DEP5, to avoid multiple middleware changes within a few Django versions.

Carl

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/679c0352-d374-a979-90e3-732ea619ac63%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to