本文整理汇总了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')