Ticket #7524: 00-url-import-exception.diff

File 00-url-import-exception.diff, 813 bytes (added by Petr Marhoun <petr.marhoun@…>, 16 years ago)
  • django/core/urlresolvers.py

    === modified file 'django/core/urlresolvers.py'
     
    252252            except Exception, e:
    253253                # Either an invalid urlconf_name, such as "foo.bar.", or some
    254254                # kind of problem during the actual import.
    255                 raise ImproperlyConfigured, "Error while importing URLconf %r: %s" % (self.urlconf_name, e)
     255                from django.conf import settings
     256                if settings.DEBUG:
     257                    raise
     258                else:
     259                    raise ImproperlyConfigured, "Error while importing URLconf %r: %s" % (self.urlconf_name, e)
    256260            return self._urlconf_module
    257261    urlconf_module = property(_get_urlconf_module)
    258262
Back to Top