=== modified file 'django/core/urlresolvers.py'
--- django/core/urlresolvers.py	2008-06-17 00:51:07 +0000
+++ django/core/urlresolvers.py	2008-06-17 00:53:03 +0000
@@ -252,7 +252,11 @@
             except Exception, e:
                 # Either an invalid urlconf_name, such as "foo.bar.", or some
                 # kind of problem during the actual import.
-                raise ImproperlyConfigured, "Error while importing URLconf %r: %s" % (self.urlconf_name, e)
+                from django.conf import settings
+                if settings.DEBUG:
+                    raise
+                else:
+                    raise ImproperlyConfigured, "Error while importing URLconf %r: %s" % (self.urlconf_name, e)
             return self._urlconf_module
     urlconf_module = property(_get_urlconf_module)
 

