Ticket #11667: django_11667_load_middleware.diff

File django_11667_load_middleware.diff, 1.2 KB (added by jedie, 6 years ago)

patch for #comment:3

  • django/core/handlers/base.py

    ### Eclipse Workspace Patch 1.0
    #P PyLucid09
     
    3434            try:
    3535                dot = middleware_path.rindex('.')
    3636            except ValueError:
     37                if settings.DEBUG:
     38                    raise
    3739                raise exceptions.ImproperlyConfigured, '%s isn\'t a middleware module' % middleware_path
    3840            mw_module, mw_classname = middleware_path[:dot], middleware_path[dot+1:]
    3941            try:
    4042                mod = import_module(mw_module)
    4143            except ImportError, e:
     44                if settings.DEBUG:
     45                    raise
    4246                raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e)
    4347            try:
    4448                mw_class = getattr(mod, mw_classname)
    4549            except AttributeError:
     50                if settings.DEBUG:
     51                    raise
    4652                raise exceptions.ImproperlyConfigured, 'Middleware module "%s" does not define a "%s" class' % (mw_module, mw_classname)
    4753
    4854            try:
Back to Top