Am Donnerstag, 29. September 2016 20:42:47 UTC+2 schrieb Sjoerd Job Postmus: > > I have a feeling this is orthogonal to the original request. > > The original request/problem was "regex is hard". > Your response answers/solves "the URL definition is somewhere different > from the view definition". > > Both issues are realistic [1], and orthogonal. >
Oh maybe, I didn't fleshed that response out appropriately. What I wanted to say, is that his regex-light approach might be worth-while implemented in a third-party package such as described by others and me before inclusion in Django core (which also prefer sooner rather than later). > [1]: I myself have great aversion to the approach where URL patterns are > spread out over the codebase, but I know others are greatly prefer the > approach that Flask takes. > I tended to have this kind of aversion as well but after a while of using the UrlMixin, I am in love with it. I think kind of this adaptation <http://www.dict.cc/englisch-deutsch/adaptation.html> stems from the fact that in 99%, 1 URL corresponds to 1 View and vice-versa. Remove the view, you remove the URL as well and vice versa. Put it differently, it makes no sense to separate URl and view in different locations. That's at least our experience while doing Web-based applications and APIs for years. Best, Sven -- 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/751b586d-0b0e-4ab2-bc42-a2d93308e769%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.