Changeset 985
- Timestamp:
- 10/20/05 18:16:45 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/template/loaders/app_directories.py
r892 r985 2 2 3 3 from django.conf.settings import INSTALLED_APPS, TEMPLATE_FILE_EXTENSION 4 from django.core.exceptions import ImproperlyConfigured 4 5 from django.core.template import TemplateDoesNotExist 5 6 import os … … 9 10 for app in INSTALLED_APPS: 10 11 i = app.rfind('.') 11 m, a = app[:i], app[i+1:] 12 mod = getattr(__import__(m, '', '', [a]), a) 12 if i == -1: 13 m, a = app, None 14 else: 15 m, a = app[:i], app[i+1:] 16 try: 17 if a is None: 18 mod = __import__(m, '', '', []) 19 else: 20 mod = getattr(__import__(m, '', '', [a]), a) 21 except ImportError, e: 22 raise ImproperlyConfigured, 'ImportError %s: %s' % (app, e.args[0]) 13 23 template_dir = os.path.join(os.path.dirname(mod.__file__), 'templates') 14 24 if os.path.isdir(template_dir):
