Changeset 215
- Timestamp:
- 07/19/05 14:04:12 (3 years ago)
- Files:
-
- django/trunk/django/core/db/__init__.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/db/__init__.py
r161 r215 19 19 dbmod = __import__('django.core.db.backends.%s' % DATABASE_ENGINE, '', '', ['']) 20 20 except ImportError: 21 # The database backend wasn't found. Display a helpful error message 22 # listing all possible database backends. 21 23 from django.core.exceptions import ImproperlyConfigured 22 raise ImproperlyConfigured, "Your DATABASE_ENGINE setting, %r, is invalid. Is it spelled correctly?" % DATABASE_ENGINE 24 import os 25 backend_dir = os.path.join(__path__[0], 'backends') 26 available_backends = [f[:-3] for f in os.listdir(backend_dir) if f.endswith('.py') and not f.startswith('__init__')] 27 available_backends.sort() 28 raise ImproperlyConfigured, "Your DATABASE_ENGINE setting, %r, is invalid. Is it spelled correctly? Available options are: %s" % \ 29 (DATABASE_ENGINE, ', '.join(map(repr, available_backends))) 23 30 24 31 DatabaseError = dbmod.DatabaseError
