diff --git a/django/db/__init__.py b/django/db/__init__.py index 5fee5004d1..03bf198d68 100644 --- a/django/db/__init__.py +++ b/django/db/__init__.py @@ -13,7 +13,7 @@ except ImportError, e: from django.core.exceptions import ImproperlyConfigured import os backend_dir = os.path.join(__path__[0], 'backends') - available_backends = [f for f in os.listdir(backend_dir) if not f.startswith('_') and not f.startswith('.')] + available_backends = [f for f in os.listdir(backend_dir) if not f.startswith('_') and not f.startswith('.') and not f.endswith('.py') and not f.endswith('.pyc')] available_backends.sort() raise ImproperlyConfigured, "Could not load database backend: %s. Is your DATABASE_ENGINE setting (currently, %r) spelled correctly? Available options are: %s" % \ (e, DATABASE_ENGINE, ", ".join(map(repr, available_backends)))