diff -ruN django_development_version/django/db/utils.py django/django/db/utils.py
old
|
new
|
|
92 | 92 | self.routers = [] |
93 | 93 | for r in routers: |
94 | 94 | if isinstance(r, basestring): |
95 | | module_name, klass_name = r.rsplit('.', 1) |
96 | | module = import_module(module_name) |
97 | | router = getattr(module, klass_name)() |
| 95 | try: |
| 96 | module_name, klass_name = r.rsplit('.', 1) |
| 97 | module = import_module(module_name) |
| 98 | router = getattr(module, klass_name)() |
| 99 | except ImportError, e: |
| 100 | raise ImproperlyConfigured('Error importing database router %s: "%s"' % (klass_name, e)) |
| 101 | except AttributeError: |
| 102 | raise ImproperlyConfigured('Module "%s" does not define a "%s" database router' % (module, klass_name)) |
98 | 103 | else: |
99 | 104 | router = r |
100 | 105 | self.routers.append(router) |