Sunday, July 10, 2016

Re: Reverse for 'resetPasswordSendMail' with arguments '()' and keyword arguments '{}' not found. 1 pattern(s) tried: [u'$resetPasswordSendMail/$']

Have you checked you didn't put a space between 'account: and resetPasswordSendMail' ?


2016-07-10 6:49 GMT+02:00 Ajo Thomas <ajo.thomas24@gmail.com>:
I am getting the error mentioned in the heading. The reverse url is working perfectly everywhere in the html code except in the form action part. The code works perfectly when I do not use namespaces in my project which right now has only one app. Example: {% url 'view_name' %} instead of {% url 'app_name:view_name' %} )

urls.py
from django.conf.urls import url, include  from django.contrib import admin  from account import views  from django.core.urlresolvers import reverse    app_name = 'account'    urlpatterns = [      #url(r'^admin/', admin.site.urls),      url(r'^$', views.login, name='login' ),      url(r'^login/$', views.login, name='login'),      url(r'^forgotPassword/$', views.forgotPassword, name='forgotPassword'),      url(r'^resetPasswordSendMail/$', views.resetPasswordSendMail, name='resetPasswordSendMail'),  ]


I am getting the error mentioned in the heading. The reverse url is working perfectly everywhere in the html code except in the form action part. The code works perfectly when I do not use namespaces in my project which right now has only one app. Example: {% url 'view_name' %} instead of {% url 'app_name:view_name' %} )

urls.py

from django.conf.urls import url, include  from django.contrib import admin  from account import views  from django.core.urlresolvers import reverse    app_name = 'account'    urlpatterns = [      #url(r'^admin/', admin.site.urls),      url(r'^$', views.login, name='login' ),      url(r'^login/$', views.login, name='login'),      url(r'^forgotPassword/$', views.forgotPassword, name='forgotPassword'),      url(r'^resetPasswordSendMail/$', views.resetPasswordSendMail, name='resetPasswordSendMail'),  ]

ForgotPassword.html

<form method="POST" role="form" id="forgotPassword" action="{% url 'account:resetPasswordSendMail' %}"> {% csrf_token %}


Views.py

def resetPasswordSendMail(request):      # code follows....

--
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/54a41772-4ddd-4404-b2b1-90d6a2bae972%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Cordialement, Coues Ludovic
+336 148 743 42

--
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/CAEuG%2BTb5W4vYS90cHXnYuX1WWzN%2BVO5pOYFdUbvJD2YT3zsMbA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment