Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #879 -- Middleware loader now throws a better error for MIDDLEW…

…ARE_CLASSES value without a dot. Thanks, Noah Slater

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1355 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b58c8205584640ca746e9cad242e6735c665c981 1 parent 5b662cd
Adrian Holovaty authored November 22, 2005

Showing 1 changed file with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. 5  django/core/handlers/base.py
5  django/core/handlers/base.py
@@ -17,7 +17,10 @@ def load_middleware(self):
17 17
         self._response_middleware = []
18 18
         self._exception_middleware = []
19 19
         for middleware_path in settings.MIDDLEWARE_CLASSES:
20  
-            dot = middleware_path.rindex('.')
  20
+            try:
  21
+                dot = middleware_path.rindex('.')
  22
+            except ValueError:
  23
+                raise exceptions.ImproperlyConfigured, '%s isn\'t look like a middleware module' % middleware_path
21 24
             mw_module, mw_classname = middleware_path[:dot], middleware_path[dot+1:]
22 25
             try:
23 26
                 mod = __import__(mw_module, '', '', [''])

0 notes on commit b58c820

Please sign in to comment.
Something went wrong with that request. Please try again.