Why Password reset unsuccessful in django rest-auth password reset

I have problem with django rest-auth password rest.

this is my urls.py file(main urls)

from django.contrib import admin from django.urls import path, include from django.conf import settings from django.conf.urls.static import static from rest_framework import permissions from drf_yasg.views import get_schema_view from drf_yasg import openapi

app_name= 'accounts'

schema_view = get_schema_view( openapi.Info( title='Blog API', description='oddiy API loyixasi', default_version='v1', terms_of_service='``https://google.com.policies.terms``', contact=openapi.Contact(email="xatamjonovulugbek17@gmail.com"), license=openapi.License('Blog API litsenziasi'), ), public=True, permission_classes=(permissions.AllowAny, ), )

urlpatterns = [ path('admin/', admin.site.urls), path('users/', include('accounts.urls')), path('', include('product.urls')),

path('dj-rest-auth/registration/', include('dj_rest_auth.registration.urls')),
path('dj-rest-auth/', include('dj_rest_auth.urls')),
path(r'^', include('django.contrib.auth.urls')),

path('auth/', include('rest_framework.urls')),
path('allauth/', include('allauth.urls')),

path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
path('redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-radoc'),

]

if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

I add

path(r'^', include('django.contrib.auth.urls')), to urls.py.

This url sent mail to counsol but I enter url in mail , I take this error: enter image description here

" Password reset unsuccessful The password reset link was invalid, possibly because it has already been used. Please request a new password reset. "

Please give me solve

I add path(r'^', include('django.contrib.auth.urls')), to urls.py. This url sent mail to counsol but I enter url in mail , I take this error: enter image description here

" Password reset unsuccessful The password reset link was invalid, possibly because it has already been used. Please request a new password reset. "

Please give me solve

path('account/api/password_reset/',PasswordResetView.as_view(), name='password_reset'),
path('account/api/password_reset_confirm/<uidb64>/<token>/', PasswordResetConfirmView.as_view(), name='password_reset_confirm'),

In case you are still working on this issue, the following urlpattern worked for me: urlpatterns link.

Also, read the FAQ questions 1 and 2. It seems to be a common issue. Source

Back to Top