Python django.contrib.auth.views 模块,password_reset_done() 实例源码

我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用django.contrib.auth.views.password_reset_done()

项目:iguana    作者:iguana-project    | 项目源码 | 文件源码
def post(self, request):
        email = request.POST['email']
        # NOTE this does not provide the email address yet, since it seems like there
        #      is a bug in django (at least imo). The path with HttpResponseRedirect omits the extra_context-field
        # s.a. http://python.6.x6.nabble.com/Django-24944-Have-password-reset-pass-extra-
        #        context-to-the-email-template-rendering-as-well-td5097076.html
        # TODO did I mean url instead of email address?
        return password_reset(request, template_name='registration/password_reset_form.html',
                              post_reset_redirect='password_reset_done', extra_context={'email': email})


# TODO BUG does it work as intended again?
项目:iguana    作者:iguana-project    | 项目源码 | 文件源码
def get(self, request):
        # TODO unfortunately the extra_context is omitted and not provided
        return password_reset_done(request, 'registration/password_reset_done.html')
项目:iguana    作者:iguana-project    | 项目源码 | 文件源码
def post(self, request):
        return password_reset_done(request, 'registration/password_reset_done.html')