Monday, March 28, 2016

Re: Getting NoReverseMatch at /logout/



On Monday, March 28, 2016 at 7:23:22 PM UTC+2, James Schneider wrote:
That's not entirely accurate. It is perfectly valid to assign a name to an included set of URL's. This creates a namespace for the URL's that are being included. See here:

Actually, the name parameter is completely ignored[1] when using include(). You can set a namespace by passing the namespace (and app_nameparameter to include()[2], or in 1.9+, by setting the app_name attribute in the target URLconf[3]. That means the name that should be used with the current code is just 'home'.

[1] https://github.com/django/django/blob/859fc64338f760508f9618c100ad92b925802b18/django/conf/urls/__init__.py#L78
[2] https://docs.djangoproject.com/en/1.8/topics/http/urls/#url-namespaces-and-included-urlconfs
[3] https://docs.djangoproject.com/en/1.9/topics/http/urls/#url-namespaces-and-included-urlconfs

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/dd0f1587-ea92-43d2-bba0-1bdd0723afab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment