diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index e30076b487..40acb7dd29 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -2808,18 +2808,34 @@ a pattern for your new view. .. _auth_password_reset: -Adding a password-reset feature +Adding a password reset feature ------------------------------- -You can add a password-reset feature to the admin site by adding a few lines to +You can add a password reset feature to the admin site by adding a few lines to your URLconf. Specifically, add these four patterns:: from django.contrib.auth import views as auth_views - url(r'^admin/password_reset/$', auth_views.PasswordResetView.as_view(), name='admin_password_reset'), - url(r'^admin/password_reset/done/$', auth_views.PasswordResetDoneView.as_view(), name='password_reset_done'), - url(r'^reset/(?P[0-9A-Za-z_\-]+)/(?P.+)/$', PasswordResetConfirmView.as_view(), name='password_reset_confirm'), - url(r'^reset/done/$', auth_views.PasswordResetCompleteView.as_view(), name='password_reset_complete'), + url( + r'^admin/password_reset/$', + auth_views.PasswordResetView.as_view(), + name='admin_password_reset', + ), + url( + r'^admin/password_reset/done/$', + auth_views.PasswordResetDoneView.as_view(), + name='password_reset_done', + ), + url( + r'^reset/(?P[0-9A-Za-z_\-]+)/(?P.+)/$', + auth_views.PasswordResetConfirmView.as_view(), + name='password_reset_confirm', + ), + url( + r'^reset/done/$', + auth_views.PasswordResetCompleteView.as_view(), + name='password_reset_complete', + ), (This assumes you've added the admin at ``admin/`` and requires that you put the URLs starting with ``^admin/`` before the line that includes the admin app