@csrf_protect
def password_reset(request, response_format='html'):

    if request.POST:
        form = PasswordResetForm(request.POST)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse('password_reset_done'))
    else:
        form = PasswordResetForm()

    return render_to_response('core/password_reset_form',
                              {'form': form},
                              context_instance=RequestContext(request),
                              response_format=response_format)
Password_reset sends the email with the new password
dataset/ETHPy150Open treeio/treeio/treeio/core/views.py/password_reset