I am using built-in Django authentication to send an email to reset a password. Sending the email works, but when I try and follow the link to the page to reset my password, Django changes the URL (kind of like a redirect I guess) and then is trying to resolve the URL to 'http://127.0.0.1:8000/registration/USER_ID/set-password', instead of 'http://127.0.0.1:8000/registration/USER_ID/TOKEN'. Django then throws an error: 'NoReverseMatch at /registration/reset/USER_ID/set-password/'
I don't have a file called "set-password" and nowhere in my code (templates, URLconf) do I have "set-password".
urlpatterns = [
...
...
path('password_reset/', auth_views.PasswordResetView.as_view(),
name='password_reset'),
path('password_reset/done/', auth_views.PasswordResetDoneView.as_view(),
name='password_reset_done'),
path('reset/<uidb64>/<token>/',
auth_views.PasswordResetConfirmView.as_view(),
name='password_reset_confirm'),
path('reset/done', auth_views.PasswordResetCompleteView.as_view(),
name='password_reset_complete'),
]
I am using the code found in the docs (https://docs.djangoproject.com/en/2.1/topics/auth/default/#using-the-views) for my URL matching, so I am not creating anything new. It seems like Django is removing the token from the URL?