diff --git a/django/contrib/admin/templatetags/admin_modify.py b/django/contrib/admin/templatetags/admin_modify.py index 835e254c43..fc8ce5d8a9 100644 --- a/django/contrib/admin/templatetags/admin_modify.py +++ b/django/contrib/admin/templatetags/admin_modify.py @@ -1,5 +1,5 @@ from django import template -from djang.core import template_loader +from django.template import loader from django.utils.html import escape from django.utils.text import capfirst from django.utils.functional import curry @@ -72,14 +72,14 @@ class FieldWidgetNode(template.Node): field_class_name = klass.__name__ template_name = "widget/%s" % \ class_name_to_underscored(field_class_name) - nodelist = template_loader.get_template(template_name).nodelist + nodelist = loader.get_template(template_name).nodelist except template.TemplateDoesNotExist: super_klass = bool(klass.__bases__) and klass.__bases__[0] or None if super_klass and super_klass != Field: nodelist = cls.get_nodelist(super_klass) else: if not cls.default: - cls.default = template_loader.get_template("widget/default").nodelist + cls.default = loader.get_template("widget/default").nodelist nodelist = cls.default cls.nodelists[klass] = nodelist @@ -169,7 +169,7 @@ class EditInlineNode(template.Node): bound_related_object = relation.bind(context['form'], original, bound_related_object_class) context['bound_related_object'] = bound_related_object - t = template_loader.get_template(bound_related_object.template_name()) + t = loader.get_template(bound_related_object.template_name()) output = t.render(context) diff --git a/django/contrib/flatpages/views.py b/django/contrib/flatpages/views.py index bdc86d258e..f88b3c4c5e 100644 --- a/django/contrib/flatpages/views.py +++ b/django/contrib/flatpages/views.py @@ -1,5 +1,5 @@ from django.contrib.flatpages.models import FlatPage -from django.core import template_loader +from django.template import loader from django.core.extensions import get_object_or_404, DjangoContext from django.http import HttpResponse from django.conf.settings import SITE_ID @@ -26,9 +26,9 @@ def flatpage(request, url): from django.views.auth.login import redirect_to_login return redirect_to_login(request.path) if f.template_name: - t = template_loader.select_template((f.template_name, DEFAULT_TEMPLATE)) + t = loader.select_template((f.template_name, DEFAULT_TEMPLATE)) else: - t = template_loader.get_template(DEFAULT_TEMPLATE) + t = loader.get_template(DEFAULT_TEMPLATE) c = DjangoContext(request, { 'flatpage': f, }) diff --git a/django/template/__init__.py b/django/template/__init__.py index 929cea179b..c6715d8b65 100644 --- a/django/template/__init__.py +++ b/django/template/__init__.py @@ -882,7 +882,7 @@ class Library(object): dict = func(*args) if not getattr(self, 'nodelist', False): - from django.core.template_loader import get_template + from django.template.loader import get_template t = get_template(file_name) self.nodelist = t.nodelist return self.nodelist.render(context_class(dict)) diff --git a/django/views/static.py b/django/views/static.py index d0b24a2f42..19b5ec2ab8 100644 --- a/django/views/static.py +++ b/django/views/static.py @@ -2,7 +2,7 @@ import os import urllib import posixpath import mimetypes -from django.core import template_loader +from django.template import loader from django.core.exceptions import ImproperlyConfigured from django.http import Http404, HttpResponse, HttpResponseRedirect from django.template import Template, Context, TemplateDoesNotExist @@ -71,7 +71,7 @@ DEFAULT_DIRECTORY_INDEX_TEMPLATE = """ def directory_index(path, fullpath): try: - t = template_loader.get_template('static/directory_index') + t = loader.get_template('static/directory_index') except TemplateDoesNotExist: t = Template(DEFAULT_DIRECTORY_INDEX_TEMPLATE) files = []