1
0
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:
Jacob Kaplan-Moss
2009-12-13 20:29:04 +00:00
parent 125403ca97
commit 1c5fe467bd
5 changed files with 51 additions and 8 deletions

View File

@@ -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))