Ticket #5350: urlresolvers.patch

File urlresolvers.patch, 822 bytes (added by Thomas Güttler <hv@…>, 17 years ago)
  • django/core/urlresolvers.py

     
    260260    url_patterns = property(_get_url_patterns)
    261261
    262262    def _resolve_special(self, view_type):
    263         callback = getattr(self.urlconf_module, 'handler%s' % view_type)
     263        callback = getattr(self.urlconf_module, 'handler%s' % view_type, None)
     264        if not callback:
     265            # Lazy import, since urls.defaults imports this file
     266            from django.conf.urls import defaults
     267            callback=getattr(defaults, 'handler%s' % view_type)
    264268        mod_name, func_name = get_mod_func(callback)
    265269        try:
    266270            return getattr(__import__(mod_name, {}, {}, ['']), func_name), {}
Back to Top