#NEWLINE# @ csrf_protect #NEWLINE# def password_reset( request , is_admin_site = False , template_name = 'registration/password_reset_form.html' , email_template_name = 'registration/password_reset_email.html' , password_reset_form = PasswordResetForm , token_generator = default_token_generator , post_reset_redirect = None , from_email = None , current_app = None , extra_context = None ) : #NEWLINE# #INDENT# if ( post_reset_redirect is None ) : #NEWLINE# #INDENT# post_reset_redirect = reverse ( 'django.contrib.auth.views.password_reset_done' ) #NEWLINE# #UNINDENT# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# form = password_reset_form ( request . POST ) #NEWLINE# if form . is_valid ( ) : #NEWLINE# #INDENT# opts = { #NEWLINE# #INDENT# 'use_https' : request . is_secure ( ) , #NEWLINE# 'token_generator' : token_generator , #NEWLINE# 'from_email' : from_email , #NEWLINE# 'email_template_name' : email_template_name , #NEWLINE# 'request' : request , #NEWLINE# #UNINDENT# } #NEWLINE# if is_admin_site : #NEWLINE# #INDENT# opts = dict ( opts , domain_override = request . META [ 'HTTP_HOST' ] ) #NEWLINE# #UNINDENT# form . save ( ** opts ) #NEWLINE# return HttpResponseRedirect ( post_reset_redirect ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# form = password_reset_form ( ) #NEWLINE# #UNINDENT# context = { #NEWLINE# #INDENT# 'form' : form , #NEWLINE# #UNINDENT# } #NEWLINE# context . update ( ( context or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) #NEWLINE# return render_to_response ( template_name , context , context_instance = RequestContext ( request , current_app = current_app ) )