Skip to content
Browse files

Fixed #5732 -- Catch all possible errors when importing a URLConf fil…

…e. This

leads to error messages that contain the name of the problem file (useful when
the problem is part of an include() import).

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 3ec6568 commit a1496b054a2b5182387053952980415543276f8f @malcolmt malcolmt committed
Showing with 3 additions and 2 deletions.
  1. +3 −2 django/core/
5 django/core/
@@ -249,8 +249,9 @@ def _get_urlconf_module(self):
except AttributeError:
self._urlconf_module = __import__(self.urlconf_name, {}, {}, [''])
- except ValueError, e:
- # Invalid urlconf_name, such as "" (note trailing period)
+ except Exception, e:
+ # Either an invalid urlconf_name, such as "", or some
+ # kind of problem during the actual import.
raise ImproperlyConfigured, "Error while importing URLconf %r: %s" % (self.urlconf_name, e)
return self._urlconf_module
urlconf_module = property(_get_urlconf_module)

0 comments on commit a1496b0

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