Ticket #879: base.py.diff

File base.py.diff, 1011 bytes (added by Noah Slater, 19 years ago)

Patch

  • core/handlers/base.py

     
    1717        self._response_middleware = []
    1818        self._exception_middleware = []
    1919        for middleware_path in settings.MIDDLEWARE_CLASSES:
    20             dot = middleware_path.rindex('.')
    21             mw_module, mw_classname = middleware_path[:dot], middleware_path[dot+1:]
    2220            try:
     21                dot = middleware_path.rindex('.')
     22                mw_module, mw_classname = middleware_path[:dot], middleware_path[dot+1:]
     23            except ValueError:
     24                raise exceptions.ImproperlyConfigured, '"%s" does not look like a middleware module' % (middleware_path)
     25            try:
    2326                mod = __import__(mw_module, '', '', [''])
    2427            except ImportError, e:
    2528                raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e)
Back to Top