Ticket #133: django-patch.diff

File django-patch.diff, 1.3 KB (added by Joeri van Ruth <jvr_djangotrac@…>, 19 years ago)

patch

  • django/core/db/__init__.py

     
    1717
    1818try:
    1919    dbmod = __import__('django.core.db.backends.%s' % DATABASE_ENGINE, '', '', [''])
    20 except ImportError:
     20except ImportError, exc:
    2121    # The database backend wasn't found. Display a helpful error message
    2222    # listing all possible database backends.
    2323    from django.core.exceptions import ImproperlyConfigured
     
    2525    backend_dir = os.path.join(__path__[0], 'backends')
    2626    available_backends = [f[:-3] for f in os.listdir(backend_dir) if f.endswith('.py') and not f.startswith('__init__')]
    2727    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)))
     28    raise ImproperlyConfigured, "Could not load database backend: %s. Is DATABASE_ENGINE (currently, %r) spelled correctly? Available options are: %s" % (exc, DATABASE_ENGINE, ", ".join(map(repr, available_backends)))
     29        #(DATABASE_ENGINE, ', '.join(map(repr, available_backends)))k
    3030
    3131DatabaseError = dbmod.DatabaseError
    3232db = dbmod.DatabaseWrapper()
Back to Top