标签云

微信群

扫码加入我们

WeChat QR Code

This question already has an answer here:What is a NoReverseMatch error, and how do I fix it?3 answersNoReverseMatch exception while resetting password in django using django's default views1 answerI am working on password reset functionality in Django using custom templates.But when I entered mail:id and clicking on reset password I'm facing "No Reverse match error".Please someone help me,I understand this is an old problem, I have followed other answers and tried solving but could not come up with solution.Please find the code below and help me solve this problem. urls.py:from django.conf.urls import url,includefrom django.contrib import adminfrom django.contrib.auth.views import password_reset,password_reset_done,password_reset_confirm,password_reset_completefrom surveysite.views import home,about,login,loggedin,loggedouturlpatterns = [url(r'^$', home, name='home'),url(r'^about/$',about, name='about'),url(r'^accounts/', include('registration.backends.default.urls')),url(r'^accounts/login/$', login, name='login'),url(r'^accounts/loggedin/$',loggedin, name='loggedin'),url(r'^accounts/logout/$', loggedout, name='logout'),url(r'^accounts/password_reset/$', password_reset, {'post_reset_redirect' : '/accounts/password_reset/mailed/'},name="password_reset"),url(r'^accounts/password_reset/mailed/$',password_reset_done),url(r'^accounts/password_reset/(?P<uidb36>[0-9A-Za-z]{1,13})-(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',password_reset_confirm, {'post_reset_redirect' : '/accounts/password_reset/complete/'},name="password_reset_confirm"),url(r'^accounts/password_reset/complete/$',password_reset_complete),url(r'^admin/', admin.site.urls),]Password_reset_email{% autoescape off %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.Please go to the following page and choose a new password:{% block reset_link %}{{ protocol }}://{{ domain }}{% url 'django.contrib.auth.views.password_reset_confirm' uidb36=uid token=token %}{% endblock %}Your username, in case you've forgotten: {{ user.get_username }}Thanks for using our site!The {{ site_name }} team{% endautoescape %}Error Stack TraceNoReverseMatch at /accounts/password_reset/Reverse for 'django.contrib.auth.views.password_reset_confirm' with arguments '()' and keyword arguments '{u'uidb36': 'MQ', u'token': u'4jz-530973903a3b600e2a97'}' not found. 0 pattern(s) tried: []Request Method: POSTRequest URL:http://localhost:8000/accounts/password_reset/Django Version: 1.10.5Exception Type: NoReverseMatchException Value:Reverse for 'django.contrib.auth.views.password_reset_confirm' with arguments '()' and keyword arguments '{u'uidb36': 'MQ', u'token': u'4jz-530973903a3b600e2a97'}' not found. 0 pattern(s) tried: []Exception Location: C:\Python27\lib\site-packages\django\urls\resolvers.py in _reverse_with_prefix, line 392Python Executable:C:\Python27\python.exePython Version: 2.7.13Python Path:['G:\\Manoj\\Software Engineering-Yui Man lee\\Django_Project\\surveysite', 'C:\\Python27', 'C:\\Python27\\Tools\\Scripts', 'G:\\Manoj\\Software Engineering-Yui Man lee\\Django_Project\\surveysite', 'C:\\WINDOWS\\SYSTEM32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27\\lib\\site-packages', 'C:\\Python27\\lib\\site-packages\\PIL']In template G:\Manoj\Software Engineering-Yui Man lee\Django_Project\surveysite\templates\registration\password_reset_email.html, error at line 6I have tried solutions from below links but could not find the solution.NoReverseMatch on password_Reset_confirmhttps://github.com/bread-and-pepper/django-userena/issues/380django password reset NoReverseMatch errorI'm following tutorial from http://code.techandstartup.com/django/reset-password/ ==> customized Templates.


Thanks for the answers, It's working with Chrome browser but yesterday I'm working with Firefox and its not working,might be issue is with my browser settings.

2019年08月26日36分58秒