Django密码重置/更改视图

I want to implement password reset/change feature in my app i just googled it & saw everyone using Django default Authentication Views. Is this the best way to do this?

我是django的新手,所以我对此不太了解,因此建议我最好的方法。

目前我实现了这个

path('password_change/done/', auth_view.PasswordChangeDoneView.as_view(
                                                template_name='registration/password_change_done.html'),
                                                name='password_change_done'),

    path('password_change/', auth_view.PasswordChangeView.as_view(
                                                template_name='registration/password_change.html'),
                                                name='password_change'),

    path('password_reset/done', auth_view.PasswordResetDoneView.as_view(
                                                template_name='registration/password_reset_done.html'),
                                                name='password_reset_done'),

    path('reset/<uidb64>/<token>/', auth_view.PasswordResetConfirmView.as_view(
                                                template_name='registration/password_reset_confirm.html'),
                                                name='password_reset_confirm'),


    path('password_reset/', auth_view.PasswordResetView.as_view(
                                                template_name='registration/password_reset_form.html'),
                                                name='password_reset'),

    path('reset/done/', auth_view.PasswordResetCompleteView.as_view(
                                                template_name='registration/password_reset_complete.html'),
                                                name='password_reset_complete')
评论