Index: django/contrib/admin/templatetags/log.py
===================================================================
--- django/contrib/admin/templatetags/log.py	(revisión: 9076)
+++ django/contrib/admin/templatetags/log.py	(copia de trabajo)
@@ -15,8 +15,8 @@
             context[self.varname] = LogEntry.objects.all().select_related('content_type', 'user')[:self.limit]
         else:
             if not self.user.isdigit():
-                self.user = context[self.user].id
-            context[self.varname] = LogEntry.objects.filter(user__id__exact=self.user).select_related('content_type', 'user')[:self.limit]
+                user_id = context[self.user].id
+            context[self.varname] = LogEntry.objects.filter(user__id__exact=user_id).select_related('content_type', 'user')[:self.limit]
         return ''
 
 class DoGetAdminLog:
Index: django/template/loader_tags.py
===================================================================
--- django/template/loader_tags.py	(revisión: 9076)
+++ django/template/loader_tags.py	(copia de trabajo)
@@ -1,6 +1,8 @@
+import copy
+
 from django.template import TemplateSyntaxError, TemplateDoesNotExist, Variable
 from django.template import Library, Node, TextNode
-from django.template.loader import get_template, get_template_from_string, find_template_source
+from django.template.loader import get_template
 from django.conf import settings
 from django.utils.safestring import mark_safe
 
@@ -43,15 +45,14 @@
         self.nodelist = nodelist
         self.parent_name, self.parent_name_expr = parent_name, parent_name_expr
         self.template_dirs = template_dirs
+        self.compiled_parent = copy.deepcopy(self.get_parent())
 
     def __repr__(self):
         if self.parent_name_expr:
             return "<ExtendsNode: extends %s>" % self.parent_name_expr.token
         return '<ExtendsNode: extends "%s">' % self.parent_name
 
-    def get_parent(self, context):
-        if self.parent_name_expr:
-            self.parent_name = self.parent_name_expr.resolve(context)
+    def get_parent(self):
         parent = self.parent_name
         if not parent:
             error_msg = "Invalid template name in 'extends' tag: %r." % parent
@@ -61,14 +62,12 @@
         if hasattr(parent, 'render'):
             return parent # parent is a Template object
         try:
-            source, origin = find_template_source(parent, self.template_dirs)
+            return get_template(parent, self.template_dirs)
         except TemplateDoesNotExist:
             raise TemplateSyntaxError, "Template %r cannot be extended, because it doesn't exist" % parent
-        else:
-            return get_template_from_string(source, origin, parent)
 
     def render(self, context):
-        compiled_parent = self.get_parent(context)
+        compiled_parent = self.compiled_parent
         parent_blocks = dict([(n.name, n) for n in compiled_parent.nodelist.get_nodes_by_type(BlockNode)])
         for block_node in self.nodelist.get_nodes_by_type(BlockNode):
             # Check for a BlockNode with this node's name, and replace it if found.
@@ -156,7 +155,7 @@
     uses the literal value "base" as the name of the parent template to extend,
     or ``{% extends variable %}`` uses the value of ``variable`` as either the
     name of the parent template to extend (if it evaluates to a string) or as
-    the parent tempate itelf (if it evaluates to a Template object).
+    the parent template itself (if it evaluates to a Template object).
     """
     bits = token.contents.split()
     if len(bits) != 2:
Index: django/template/loader.py
===================================================================
--- django/template/loader.py	(revisión: 9076)
+++ django/template/loader.py	(copia de trabajo)
@@ -26,6 +26,8 @@
 
 template_source_loaders = None
 
+_template_cache = {}
+
 class LoaderOrigin(Origin):
     def __init__(self, display_name, loader, name, dirs):
         super(LoaderOrigin, self).__init__(display_name)
@@ -72,13 +74,16 @@
             pass
     raise TemplateDoesNotExist, name
 
-def get_template(template_name):
+def get_template(template_name, dirs=None, from_child=None):
     """
     Returns a compiled Template object for the given template name,
     handling template inheritance recursively.
     """
-    source, origin = find_template_source(template_name)
+    if template_name in _template_cache:
+        return _template_cache[template_name]
+    source, origin = find_template_source(template_name, dirs)
     template = get_template_from_string(source, origin, template_name)
+    _template_cache[template_name] = template
     return template
 
 def get_template_from_string(source, origin=None, name=None):
