4👍
✅
Since you specified an app_name = 'crm'
, it means the name of the views should be preced with app_name:
, so here for example crm:password_reset_confirm
.
The urls are written in the views, but we can override these, for example with:
from django.urls import reverse_lazy
from django.urls import path
from . import views
from django.contrib.auth import views as auth_views
app_name = 'crm'
urlpatterns = [
path('', views.home, name='dashboard'),
path('login/', views.loginPage, name='login'),
path('register/', views.registerPage, name='register'),
path('logout/', views.logoutUser, name='logout'),
path(
'reset_password/',
auth_views.PasswordResetView.as_view(success_url=reverse_lazy('crm:password_reset_done')),
name='reset_password'
),
path(
'reset_password_sent/',
auth_views.PasswordResetDoneView.as_view(),
name='password_reset_done'
),
path(
'reset/<uidb64>/<token>/',
auth_views.PasswordResetConfirmView.as_view(success_url=reverse_lazy('crm:password_reset_complete')),
name='password_reset_confirm'
),
path(
'reset_password_complete/',
auth_views.PasswordResetCompleteView.as_view(),
name='password_reset_complete'
)
]
0👍
Django 3.2.5 and Python 3.8.10 – same error
In my case, I had to define an email_template_name for PasswordResetView, and recreate that email template.
# ...
path(
'reset_password/',
auth_views.PasswordResetView.as_view(
success_url=reverse_lazy('crm:password_reset_done'),
email_template_name='my_email.html'
),
name='reset_password'
),
# ...
Source:stackexchange.com