5👍
When using the url
template tag, you need to specify the view and not the url itself. Since you are using 'django.contrib.auth.views.password_reset_confirm'
in your URLConf you should use it like this:
{% url 'django.contrib.auth.views.password_reset_confirm' ... %}
More on the url
template tag on Django’s Built-in template tags and filters documentation.
12👍
To pass a url to the url
template tag, you can specify a name
to the url in the urls.py
url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
views.password_reset_confirm, name='password_reset_confirm'),
and then you can use the tag with the url name
{% url 'password_reset_confirm' uidb64=uid token=token %}
- How to combine django plus gevent the basics?
- Django __call__() missing 1 required keyword-only argument: 'manager'
- Django: WSGIRequest' object has no attribute 'user' on some pages?
- Changing password in Django Admin
1👍
Be sure to have this in your urls.py:
urlpatterns = [
url('^', include('django.contrib.auth.urls'))
]
See https://docs.djangoproject.com/en/1.8/topics/auth/default/#django.contrib.auth.views.password_reset
Section: Authentication views
0👍
It might be a built-in view, but you still need a URL for it. You should define one in urls.py and link it up to the password_reset_confirm
view.
- Override save_model on Django InlineModelAdmin
- How to unit test methods inside django's class based views?
- Django model inheritance and type check
0👍
Just copy this URL to your main urls.py file, so that it recognizes the URL name
url(r’^reset/(?P[0-9A-Za-z_-]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$’,
‘django.contrib.auth.views.password_reset_confirm’,
name=’password_reset_confirm’),