Index: django/django/contrib/auth/views.py
===================================================================
--- django/django/contrib/auth/views.py	(revision 5174)
+++ django/django/contrib/auth/views.py	(working copy)
@@ -2,13 +2,13 @@
 from django.contrib.auth.forms import PasswordResetForm, PasswordChangeForm
 from django import oldforms
 from django.shortcuts import render_to_response
-from django.template import RequestContext
+from django.template import loader, RequestContext
 from django.contrib.sites.models import Site
-from django.http import HttpResponseRedirect
+from django.http import HttpResponse, HttpResponseRedirect
 from django.contrib.auth.decorators import login_required
 from django.contrib.auth import REDIRECT_FIELD_NAME
 
-def login(request, template_name='registration/login.html'):
+def login(request, template_name='registration/login.html', template_loader=loader):
     "Displays the login form and handles the login action."
     manipulator = AuthenticationForm(request)
     redirect_to = request.REQUEST.get(REDIRECT_FIELD_NAME, '')
@@ -26,18 +26,23 @@
     else:
         errors = {}
     request.session.set_test_cookie()
-    return render_to_response(template_name, {
+    context = RequestContext(request, {
         'form': oldforms.FormWrapper(manipulator, request.POST, errors),
         REDIRECT_FIELD_NAME: redirect_to,
         'site_name': Site.objects.get_current().name,
-    }, context_instance=RequestContext(request))
+    })
+    t = template_loader.get_template(template_name)
+    return HttpResponse(t.render(context))
 
-def logout(request, next_page=None, template_name='registration/logged_out.html'):
+def logout(request, next_page=None, template_name='registration/logged_out.html',
+           template_loader=loader):
     "Logs out the user and displays 'You are logged out' message."
     from django.contrib.auth import logout
     logout(request)
     if next_page is None:
-        return render_to_response(template_name, {'title': _('Logged out')}, context_instance=RequestContext(request))
+        context = RequestContext(request, {'title': _('Logged out')})
+        t = template_loader.get_template(template_name)
+        return HttpResponse(t.render(context))
     else:
         # Redirect to this page until the session has been cleared.
         return HttpResponseRedirect(next_page or request.path)
@@ -57,7 +62,7 @@
     return HttpResponseRedirect('%s?%s=%s' % (login_url, REDIRECT_FIELD_NAME, next))
 
 def password_reset(request, is_admin_site=False, template_name='registration/password_reset_form.html',
-        email_template_name='registration/password_reset_email.html'):
+        email_template_name='registration/password_reset_email.html', template_loader=loader):
     new_data, errors = {}, {}
     form = PasswordResetForm()
     if request.POST:
@@ -69,13 +74,19 @@
             else:
                 form.save(email_template_name=email_template_name)
             return HttpResponseRedirect('%sdone/' % request.path)
-    return render_to_response(template_name, {'form': oldforms.FormWrapper(form, new_data, errors)},
-        context_instance=RequestContext(request))
+    context = RequestContext(request,
+         {'form': oldforms.FormWrapper(form, new_data, errors)})
+    t = template_loader.get_template(template_name)
+    return HttpResponse(t.render(context))
 
-def password_reset_done(request, template_name='registration/password_reset_done.html'):
-    return render_to_response(template_name, context_instance=RequestContext(request))
+def password_reset_done(request, template_name='registration/password_reset_done.html',
+        template_loader=loader):
+    context = RequestContext(request)
+    t = template_loader.get_template(template_name)
+    return HttpResponse(t.render(context))
 
-def password_change(request, template_name='registration/password_change_form.html'):
+def password_change(request, template_name='registration/password_change_form.html',
+        template_loader=loader):
     new_data, errors = {}, {}
     form = PasswordChangeForm(request.user)
     if request.POST:
@@ -84,9 +95,14 @@
         if not errors:
             form.save(new_data)
             return HttpResponseRedirect('%sdone/' % request.path)
-    return render_to_response(template_name, {'form': oldforms.FormWrapper(form, new_data, errors)},
-        context_instance=RequestContext(request))
+    context = RequestContext(request,
+        {'form': oldforms.FormWrapper(form, new_data, errors)})
+    t = template_loader.get_template(template_name)
+    return HttpResponse(t.render(context))
 password_change = login_required(password_change)
 
-def password_change_done(request, template_name='registration/password_change_done.html'):
-    return render_to_response(template_name, context_instance=RequestContext(request))
+def password_change_done(request, template_name='registration/password_change_done.html',
+        template_loader=loader):
+    context = RequestContext(request)
+    t = template_loader.get_template(template_name)
+    return HttpResponse(t.render(context))
