pythondjangodjango-allauth

Customizing django-allauth password_reset_from_key template


I'm using django 2.2.3, I'm overriding django-allauth templates and on password_reset_from_key template I came across a NoReverseMatch Exception,

Reverse for 'account_reset_password_from_key' with no arguments not found. 1 pattern(s) tried: ['accounts/password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$']

So it expects argument and probably that argument is the key that is generated during resetting password. From the URL pattern, 'key' is the variable's name

I tried to pass it with 'key'.

<form method="POST" action="{% url 'account_reset_password_from_key' key %}">
...
</form>

but it did not work. What is wrong?


Solution

  • If you're not overriding the allauth view, then use action_url:

    <form method="POST" action="{{ action_url }}">
    

    that's what the view passes to the template.