1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #626 -- Moved template modules to django.core.template package. django.core.template_loader is deprecated, in favor of django.core.template.loader.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@867 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2005-10-14 20:10:13 +00:00
parent b773bf45c3
commit f71f854628
21 changed files with 355 additions and 374 deletions

View File

@@ -1,6 +1,6 @@
from django.utils import httpwrappers
from django.core import template_loader
from django.core.extensions import DjangoContext as Context
from django.core.extensions import DjangoContext
from django.core.extensions import render_to_response
from django.models.auth import users
from django.views.registration import passwords
from django.views.auth.login import logout
@@ -96,14 +96,12 @@ class AdminUserRequired:
post_data = encode_post_data(request.POST)
else:
post_data = encode_post_data({})
t = template_loader.get_template(self.get_login_template_name())
c = Context(request, {
return render_to_response(self.get_login_template_name(), {
'title': 'Log in',
'app_path': request.path,
'post_data': post_data,
'error_message': error_message
})
return httpwrappers.HttpResponse(t.render(c))
}, context_instance=DjangoContext(request))
def authenticate_user(self, user, password):
return user.check_password(password) and user.is_staff