本文整理匯總了Python中django.contrib.auth.views.password_reset方法的典型用法代碼示例。如果您正苦於以下問題:Python views.password_reset方法的具體用法?Python views.password_reset怎麽用?Python views.password_reset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類django.contrib.auth.views
的用法示例。
在下文中一共展示了views.password_reset方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: forgot_passwd
# 需要導入模塊: from django.contrib.auth import views [as 別名]
# 或者: from django.contrib.auth.views import password_reset [as 別名]
def forgot_passwd(request):
"""
User password reset page.
"""
dc_settings = request.dc.settings
return password_reset(
request,
template_name='gui/accounts/forgot.html',
email_template_name='gui/accounts/forgot_email.txt',
subject_template_name='gui/accounts/forgot_subject.txt',
password_reset_form=partial(ForgotForm, request),
post_reset_redirect=reverse('forgot_done'),
from_email=dc_settings.DEFAULT_FROM_EMAIL,
current_app='gui',
extra_context={
'e_site_name': dc_settings.SITE_NAME,
'e_site_link': dc_settings.SITE_LINK,
})
示例2: password_reset
# 需要導入模塊: from django.contrib.auth import views [as 別名]
# 或者: from django.contrib.auth.views import password_reset [as 別名]
def password_reset(request):
u"""View responsible for password reset."""
return auth_views.password_reset(
request,
template_name='auth/password_reset.html',
post_reset_redirect='login',
from_email=FROM_ADDRESS,
subject_template_name='emails/password_reset.subject',
email_template_name='emails/password_reset.txt',
html_email_template_name='emails/password_reset.html',
)
示例3: test_password_reset_url_and_template
# 需要導入模塊: from django.contrib.auth import views [as 別名]
# 或者: from django.contrib.auth.views import password_reset [as 別名]
def test_password_reset_url_and_template(self):
self.check_url('/accounts/password/reset/', auth_views.password_reset)
self.check_template('accounts:password-reset',
'accounts/password_reset.html')