Going off topic a little bit but.. have we considered deprecating string
based includes in favour of actually importing the urls module?
from . import myapp
urlpatterns = (
url(r'^myapp/', include(myapp.urls.urlpatterns)),
)
Then users can relatively import their nested app patterns as they will.
Even if we didn't deprecate string based imports I'm wary of increasing
their utility.
On Tuesday, 1 March 2016 00:17:39 UTC+11, Tim Graham wrote:
>
> For example, within myproject.urls:
>
>
> urlpatterns = (
> url(r'', include('.myapp.urls')),
> )
>
>
> .. becomes equivalent to::
>
> urlpatterns = (
> url(r'', include('myproject.myapp.urls')),
> )
>
>
> Whilst a contrived example, this can make heavy-nested apps look far, far
> cleaner. For example, within myproject.foo.foo_bar.foo_bar_baz.urls, one
> only needs to include .foo_bar_baz_qux.urls to get to the "next" level,
> rather than the significantly more unwieldy
> myproject.foo.foo_bar.foo_bar_baz.foo.bar_baz_qux.urls.
>
> ----
>
> What do you think of this proposal from
> https://code.djangoproject.com/ticket/26288? I don't know if "nested
> apps" are very common and/or something that should be promoted with a
> change like this.
>
--
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 [email protected].
To post to this group, send email to [email protected].
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/20f41a42-55ec-45b1-912f-f261e2450f6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.