992 | | if not module_has_submodule(app_module, taglib): |
993 | | return None |
994 | | else: |
995 | | raise InvalidTemplateLibrary("ImportError raised loading %s: %s" % (taglib_module, e)) |
| 990 | if '.' in taglib_module: |
| 991 | app_path, taglib = taglib_module.rsplit('.',1) |
| 992 | app_module = import_module(app_path) |
| 993 | if not module_has_submodule(app_module, taglib): |
| 994 | return None |
| 995 | raise InvalidTemplateLibrary("ImportError raised loading %s: %s" % (taglib_module, e)) |
1037 | | for module in templatetags_modules: |
1038 | | taglib_module = '%s.%s' % (module, library_name) |
1039 | | tried_modules.append(taglib_module) |
1040 | | lib = import_library(taglib_module) |
1041 | | if lib: |
1042 | | libraries[library_name] = lib |
1043 | | break |
| 1036 | # first try the fully qualified module path |
| 1037 | taglib_module = library_name |
| 1038 | tried_modules.append(taglib_module) |
| 1039 | lib = import_library(taglib_module) |
| 1040 | if lib: |
| 1041 | libraries[library_name] = lib |
| 1042 | else: # then search inside installed apps |
| 1043 | templatetags_modules = get_templatetags_modules() |
| 1044 | for module in templatetags_modules: |
| 1045 | taglib_module = '%s.%s' % (module, library_name) |
| 1046 | tried_modules.append(taglib_module) |
| 1047 | lib = import_library(taglib_module) |
| 1048 | if lib: |
| 1049 | libraries[library_name] = lib |
| 1050 | break |