mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #10326: handler500 and handler404 may now be callables. Thanks, dcwatson, adurdin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11854 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -257,9 +257,8 @@ class RegexURLResolver(object):
|
||||
|
||||
def _resolve_special(self, view_type):
|
||||
callback = getattr(self.urlconf_module, 'handler%s' % view_type)
|
||||
mod_name, func_name = get_mod_func(callback)
|
||||
try:
|
||||
return getattr(import_module(mod_name), func_name), {}
|
||||
return get_callable(callback), {}
|
||||
except (ImportError, AttributeError), e:
|
||||
raise ViewDoesNotExist, "Tried %s. Error was: %s" % (callback, str(e))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user