[Fixed]-NoReverseMatch at /user_details/reset-password


Right, I had to resolve to overwriting the Django default email, because the reverse URL lookup doesn’t want to behave properly.

So I created a copy of the original Django email file (/usr/lib/python2.7/dist-packages/django/contrib/admin/templates/registration/password_reset_email.html):

{% load i18n %}{% autoescape off %}
{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}

{% trans "Please go to the following page and choose a new password:" %}
{% block reset_link %}
{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}
{% endblock %}
{% trans "Your username, in case you've forgotten:" %} {{ user.get_username }}

{% trans "Thanks for using our site!" %}

{% blocktrans %}The {{ site_name }} team{% endblocktrans %}

{% endautoescape %}

and replaced line 6 with the following:

{{ protocol }}://{{ domain }}/user_details/reset/{{uid}}/{{token}}

which matches my urls.py.

This does indeed work now…


You have defined a URL which accepts a “uidb36” parameter, but the reverse call is passing “uidb64”.

Leave a comment