macropin / django-registration

Django-registration (redux) provides user registration functionality for Django websites.
http://django-registration-redux.readthedocs.org
Other
975 stars 350 forks source link

Add support for Django 1.11 #252

Closed nagracks closed 6 years ago

nagracks commented 7 years ago

If I include urls with namespace

    url(r'^accounts/', include('registration.backends.simple.urls', namespace='registration')),

And use it like this in template

<li><a href="{% url 'registration:auth_login' %}">Login</a></li>

then it is not working in latest Django.

dicato commented 7 years ago

What do you mean by not working? Is there an exception being thrown?

nagracks commented 7 years ago

Yes it throws this exception

django.urls.exceptions.NoReverseMatch: Reverse for 'auth_password_reset_done' not found. 'auth_password_reset_done' is not a valid view function or pattern name.
joshblum commented 7 years ago

@nagracks my guess would be that it's because the auth_urls are not included with the namespace: https://github.com/macropin/django-registration/blob/master/registration/backends/default/urls.py#L61 can you confirm this is the issue?

timgraham commented 7 years ago

I couldn't reproduce this crash.

fchevitarese commented 7 years ago

I'm having the same issue. I've updated my project to Django 1.10.5, and now, /accounts/login does not work and throw this error: Any idea?


NoReverseMatch: Reverse for 'django.contrib.auth.views.login' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
timgraham commented 7 years ago

If you upgraded from 1.9 or earlier it might be related to this item in the 1.10 release notes: "The ability to reverse() URLs using a dotted Python path is removed." Does your URL pattern you are trying to reverse have a name?

fchevitarese commented 7 years ago

They are like this:

    from django.contrib.auth.views import login, logout
    url(r'^accounts/', include('registration.backends.default.urls')),
    url(r'^login/$', login, name='account_login'),
    url(r'^logout/$', logout, name='account_logout'),

The accounts/login doesn't work. Not even login and logout works :( But it used to work

timgraham commented 7 years ago

It looks like you need to give login a name of 'django.contrib.auth.views.login'.

fchevitarese commented 7 years ago

Forget it ... it worked ^^ Thanks!

timgraham commented 7 years ago

One more thing that could be done when closing this is to add 1.11 to the "django-registration (redux) now with Django 1.8/1.9/1.10" tag at the top of https://github.com/macropin/django-registration.

joshblum commented 7 years ago

@timgraham agreed, only @macropin can change that currently so I'll let him edit and close this issue out.

joshblum commented 6 years ago

@macropin can you update the tagline to close this issue?

fchevitarese commented 6 years ago

I'm not sure how to do this. Can you help me?

Em 13/09/2017 11:40, "Joshua Blum" notifications@github.com escreveu:

@macropin https://github.com/macropin can you update the tagline to close this issue?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/macropin/django-registration/issues/252#issuecomment-329189360, or mute the thread https://github.com/notifications/unsubscribe-auth/AACAx_cM_D9PcVhh_JVeg6iPoYpC-8CEks5sh-ljgaJpZM4M_XX_ .

joshblum commented 6 years ago

@fchevitarese only @macropin can update the tagline as the repository owner. Thanks for reaching out though!

timgraham commented 6 years ago

The tagline no longer includes the Django version so I think this can be closed.