Hi Axel,
Marten
On Monday, December 14, 2015 at 1:37:56 PM UTC+1, Axel...@Chaos1.DE wrote:
-- An installed application and a registered URL namespace are two distinct concepts. A URL namespace can only be defined by setting the app_name attribute in your urlconf. In this case, you haven't set a URL namespace for your authentication app, so your urls are not namespaced.
Also, the urlconf parameter to reverse() should point to the root urlconf, not to the urlconf in which your current url is defined. Since it defaults to the root urlconf defined in your project, it's easiest to omit it in most cases. If you don't, and use 'authentication.urls' as your root urlconf, the generated url will miss the 'authentication/' part of your url.
To reverse the password_change url, simply use this:
reverse('password_change')On Monday, December 14, 2015 at 1:37:56 PM UTC+1, Axel...@Chaos1.DE wrote:
In my root url, I have:
url(r'^authentication/', include('authentication.urls')),
in authentication/urls.py, I have no app_name declared.
In a module in authentication, I have
from django.core.urlresolvers import reverse
from django.apps import apps
print('authentication installed? ' + str(apps.is_installed('authentication')))
reverse('authentication:password_ change',urlconf=' authentication.urls')
and receive
django.core.urlresolvers.NoReverseMatch: 'authentication' is not a registered namespace
while the above debug print gives
authentication installed? True
What am I doing wrong here?
Please advice,
Axel
—
PGP-Key:29E99DD6 ☀ +49 160 9945 7889 ☀ computing @ chaos claudius
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/fc585533-0cb4-4419-8944-b38cbf4b472c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment