Just learning about auth in django and getting error NoReverseMatch ; Exception Value: Reverse for 'password_reset_done' with arguments

240 views
Skip to first unread message

Thames Khi

unread,
Apr 7, 2017, 1:55:10 PM4/7/17
to Django users
My example is simple, I am happy to use the standard views and templates provided by Django.


NoReverseMatch at /myapp/password/reset/

Reverse for 'password_reset_done' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
Request Method:GET
Request URL:http://192.168.0.2:8000/myapp/password/reset/
Django Version:1.10.6
Exception Type:NoReverseMatch
Exception Value:
Reverse for 'password_reset_done' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
Exception Location:H:\APPS\Python35-32\lib\site-packages\django\urls\resolvers.py in _reverse_with_prefix, line 392
Python Executable:H:\APPS\Python35-32\python.exe


My code:

Urls.py

from django.conf.urls import url
from django.core.urlresolvers import reverse_lazy
from . import views
from django.contrib.auth.views import ( login,
                                        logout,
                                        password_reset,
                                        password_reset_done,
                                        password_reset_confirm,
                                        password_reset_complete
                                        )

app_name = 'myapp'

urlpatterns = [
    # /prices/

  url(r'^$', views.home, name='home'),
  url(r'^myapp/',views.home, name='home'),
  url(r'^login/$', login, {'template_name':'myapp/login.html'}),
  url(r'^logout/$', logout, {'template_name': 'myapp/logged_out.html'}),
  url(r'^register/', views.register, name='register'),
  url(r'^profile/$', views.profile, name='profile'),
  url(r'^edit/$', views.edit_profile, name='edit_profile'),
  url(r'^change-pass', views.change_password, name='change_password'),
  url(r'^password/reset/done/$', password_reset_done, name='password_reset_done'),
  url(r'^password/reset/$', password_reset, name='password_reset'),
  url(r'^password/reset/confirm/$', password_reset_confirm, name='password_reset_confirm'),
  url(r'^password/reset/complete/$', password_reset_complete, name='password_reset_complete')

]



ludovic coues

unread,
Apr 8, 2017, 9:53:11 AM4/8/17
to django...@googlegroups.com
It's hard to tell what is wrong without the full traceback or thecode causing the exception.

I would suggest to replace reverse("password_reset_done") with reverse("myapp:password_reset_done").
Might be as simple as that.

--
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...@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/1a9a9f0e-21d8-4038-a681-1736c1cc0073%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Cordialement, Ludovic Coues
+33 6 14 87 43 42
Reply all
Reply to author
Forward
0 new messages