Ticket #15621: db-backend-error.diff
File db-backend-error.diff, 1.1 KB (added by , 14 years ago) |
---|
-
django/db/utils.py
41 41 and not f.startswith('.')] 42 42 except EnvironmentError: 43 43 available_backends = [] 44 available_backends.sort() 44 if backend_name.startswith('django.db.backends.'): 45 backend_name = backend_name[19:] 45 46 if backend_name not in available_backends: 46 47 error_msg = ("%r isn't an available database backend. \n" + 47 48 "Try using django.db.backends.XXX, where XXX is one of:\n %s\n" + 48 49 "Error was: %s") % \ 49 (backend_name, ", ".join(map(repr, available_backends)), e_user)50 (backend_name, ", ".join(map(repr, sorted(available_backends))), e_user) 50 51 raise ImproperlyConfigured(error_msg) 51 52 else: 52 53 raise # If there's some other error, this must be an error in Django itself.