diff --git a/django/template/__init__.py b/django/template/__init__.py
index 5c4ab30..1d61387 100644
--- a/django/template/__init__.py
+++ b/django/template/__init__.py
@@ -59,6 +59,7 @@ from django.utils.encoding import smart_unicode, force_unicode
 from django.utils.translation import ugettext as _
 from django.utils.safestring import SafeData, EscapeData, mark_safe, mark_for_escaping
 from django.utils.html import escape
+from django.templatetags import get_templatetags_modules 
 
 __all__ = ('Template', 'Context', 'RequestContext', 'compile_string')
 
@@ -913,22 +914,43 @@ class Library(object):
             return func
         return dec
 
-def get_library(module_name):
-    lib = libraries.get(module_name, None)
+def import_library(module_name):
+    try:
+        mod = __import__(module_name, {}, {}, [''])
+    except ImportError:
+        return None
+    try:
+        return mod.register
+    except AttributeError:
+        raise InvalidTemplateLibrary("Template library %s does not have a variable named 'register'" % module_name)
+
+def get_library(library_name):
+    lib = libraries.get(library_name, None)
     if not lib:
-        try:
-            mod = __import__(module_name, {}, {}, [''])
-        except ImportError, e:
-            raise InvalidTemplateLibrary("Could not load template library from %s, %s" % (module_name, e))
-        try:
-            lib = mod.register
-            libraries[module_name] = lib
-        except AttributeError:
-            raise InvalidTemplateLibrary("Template library %s does not have a variable named 'register'" % module_name)
+
+        """ 
+        If library is not already loaded loop over all templatetags modules to locate it.
+
+        {% load somelib %} and {% load someotherlib %} loops twice.
+
+        Subsequent loads eg. {% load somelib %} in the same thread will grab the cached
+        module from libraries.
+        """
+        templatetags_modules = get_templatetags_modules()
+        tried_modules = []
+        for module in templatetags_modules:
+            taglib_module = '%s.%s' % (module, library_name) 
+            tried_modules.append(taglib_module)
+            lib = import_library(taglib_module)
+            if lib:
+                libraries[library_name] = lib
+                break
+        if not lib:
+            raise InvalidTemplateLibrary("Template library %s not found, tried %s" % (library_name, ','.join(tried_modules))) 
     return lib
 
 def add_to_builtins(module_name):
-    builtins.append(get_library(module_name))
+    builtins.append(import_library(module_name))
 
 add_to_builtins('django.template.defaulttags')
 add_to_builtins('django.template.defaultfilters')
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
index cf3b35b..665c30a 100644
--- a/django/template/defaulttags.py
+++ b/django/template/defaulttags.py
@@ -850,7 +850,7 @@ def load(parser, token):
     for taglib in bits[1:]:
         # add the library to the parser
         try:
-            lib = get_library("django.templatetags.%s" % taglib)
+            lib = get_library(taglib)
             parser.add_library(lib)
         except InvalidTemplateLibrary, e:
             raise TemplateSyntaxError("'%s' is not a valid tag library: %s" %
diff --git a/django/templatetags/__init__.py b/django/templatetags/__init__.py
index 9204535..93a97b4 100644
--- a/django/templatetags/__init__.py
+++ b/django/templatetags/__init__.py
@@ -1,7 +1,15 @@
 from django.conf import settings
 
-for a in settings.INSTALLED_APPS:
-    try:
-        __path__.extend(__import__(a + '.templatetags', {}, {}, ['']).__path__)
-    except ImportError:
-        pass
+templatetags_modules= [] 
+
+def get_templatetags_modules():
+    if not templatetags_modules:
+        """ Populate list once per thread. """
+        for app_module in ['django'] + list(settings.INSTALLED_APPS):
+            try:
+                name = '%s.templatetags' % app_module
+                mod = __import__(name, {}, {}, [''])
+                templatetags_modules.append(name)
+            except ImportError:
+                pass
+    return templatetags_modules 
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 4effea5..dc61a8a 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -48,7 +48,7 @@ def do_echo(parser, token):
 
 register.tag("echo", do_echo)
 
-template.libraries['django.templatetags.testtags'] = register
+template.libraries['testtags'] = register
 
 #####################################
 # Helper objects for template tests #
