### Eclipse Workspace Patch 1.0
#P PyLucid09
|
|
|
34 | 34 | try: |
35 | 35 | dot = middleware_path.rindex('.') |
36 | 36 | except ValueError: |
| 37 | if settings.DEBUG: |
| 38 | raise |
37 | 39 | raise exceptions.ImproperlyConfigured, '%s isn\'t a middleware module' % middleware_path |
38 | 40 | mw_module, mw_classname = middleware_path[:dot], middleware_path[dot+1:] |
39 | 41 | try: |
40 | 42 | mod = import_module(mw_module) |
41 | 43 | except ImportError, e: |
| 44 | if settings.DEBUG: |
| 45 | raise |
42 | 46 | raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e) |
43 | 47 | try: |
44 | 48 | mw_class = getattr(mod, mw_classname) |
45 | 49 | except AttributeError: |
| 50 | if settings.DEBUG: |
| 51 | raise |
46 | 52 | raise exceptions.ImproperlyConfigured, 'Middleware module "%s" does not define a "%s" class' % (mw_module, mw_classname) |
47 | 53 | |
48 | 54 | try: |