Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse for 'password_reset_confirm' not found. 'password_reset_confirm' is not a valid view function or pattern name. #651

Open
vahidkoohkan opened this issue Jan 11, 2022 · 6 comments

Comments

@vahidkoohkan
Copy link

Hi!
This error occurs when the email is entered correctly:
django.urls.exceptions.NoReverseMatch: Reverse for 'password_reset_confirm' not found. 'password_reset_confirm' is not a valid view function or pattern name.
And when the wrong email is entered, this response will be returned:

{
    "detail": "Password reset e-mail has been sent."
}

(The result was the same in both logged in and logged out modes)

a part of my code:

from django.urls import include, path

urlpatterns = [
    path('rest-auth/', include('rest_auth.urls')),
    path('rest-auth/registration/', include('rest_auth.registration.urls')),

I also tried this code but it was not useful:

from django.urls import include, path, re_path
from rest_auth.views import PasswordResetConfirmView

re_path(r'^rest-auth/password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', PasswordResetConfirmView.as_view(),
            name='password_reset_confirm'),

django-rest-auth == 0.9.5
Django == 3.2.9
python == 3.9.0

@mikiyas-Haile
Copy link

mikiyas-Haile commented Mar 19, 2022

Add this pattern, It worked for me.

from django.urls import include, path, re_path
from rest_auth.views import PasswordResetConfirmView
urlpatterns = [
# ...
        path('rest-auth/password/reset/confirm/<str:uidb64>/<str:token>', PasswordResetConfirmView.as_view(),
            name='password_reset_confirm'),
# ..
]

@swalih-mohammed
Copy link

solved mine too

@Rahmani21
Copy link

Add this pattern, It worked for me.

from django.urls import include, path, re_path
from rest_auth.views import PasswordResetConfirmView
urlpatterns = [
# ...
        path('rest-auth/password/reset/confirm/<str:uidb64>/<str:token>', PasswordResetConfirmView.as_view(),
            name='password_reset_confirm'),
# ..
]

Still not workink

@elinteerie
Copy link

did not work for me

@SiddhantTotade
Copy link

Hi! This error occurs when the email is entered correctly: django.urls.exceptions.NoReverseMatch: Reverse for 'password_reset_confirm' not found. 'password_reset_confirm' is not a valid view function or pattern name. And when the wrong email is entered, this response will be returned:

{
    "detail": "Password reset e-mail has been sent."
}

(The result was the same in both logged in and logged out modes)

a part of my code:

from django.urls import include, path

urlpatterns = [
    path('rest-auth/', include('rest_auth.urls')),
    path('rest-auth/registration/', include('rest_auth.registration.urls')),

I also tried this code but it was not useful:

from django.urls import include, path, re_path
from rest_auth.views import PasswordResetConfirmView

re_path(r'^rest-auth/password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', PasswordResetConfirmView.as_view(),
            name='password_reset_confirm'),

django-rest-auth == 0.9.5 Django == 3.2.9 python == 3.9.0

I am also having the same issue. when i pass an incorrect email in password/reset then it shows success message Password reset e-mail has been sent. but when i pass the actual email which exist in the database it throws error.

Why is this happening? someone tell me

urlpatterns = [
    path("admin/", admin.site.urls),
    path("auth/", include("dj_rest_auth.urls")),
    path("auth/registration/", include("dj_rest_auth.registration.urls")),
    path("auth/password/reset", PasswordResetView.as_view(), name="rest_password_reset"),
    path("auth/registration/account-confirm-email/<str:key>/", redirect_email_confirm, name="account_email_verification_sent"),
    path("auth/reset/passowrd/confirm/<int:uid>/<str:token>/", reset_password_confirm, name="password_reset_confirm"),
    path('auth/google/', GoogleLogin.as_view(), name='google_login'),
]

@Rahmani21
Copy link

Rahmani21 commented Dec 2, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants