Ticket #10326: handlerXXX_callable.diff
File handlerXXX_callable.diff, 2.0 KB (added by , 16 years ago) |
---|
-
django/core/urlresolvers.py
213 213 214 214 def _resolve_special(self, view_type): 215 215 callback = getattr(self.urlconf_module, 'handler%s' % view_type) 216 mod_name, func_name = get_mod_func(callback)217 216 try: 218 return get attr(__import__(mod_name, {}, {}, ['']), func_name), {}217 return get_callable(callback), {} 219 218 except (ImportError, AttributeError), e: 220 219 raise ViewDoesNotExist, "Tried %s. Error was: %s" % (callback, str(e)) 221 220 -
docs/topics/http/urls.txt
244 244 handler404 245 245 ---------- 246 246 247 A string representing the full Python import path to the view that should be248 called if none of the URL patterns match.247 A callable, or a string representing the full Python import path to the view 248 that should be called if none of the URL patterns match. 249 249 250 250 By default, this is ``'django.views.defaults.page_not_found'``. That default 251 251 value should suffice. 252 252 253 .. versionchanged:: 1.1 254 Previous versions of Django only accepted strings representing import paths. 255 253 256 handler500 254 257 ---------- 255 258 256 A string representing the full Python import path to the view that should be257 called in case of server errors. Server errors happen when you have runtime 258 errors in view code.259 A callable, or a string representing the full Python import path to the view 260 that should be called in case of server errors. Server errors happen when you 261 have runtime errors in view code. 259 262 260 263 By default, this is ``'django.views.defaults.server_error'``. That default 261 264 value should suffice. 262 265 266 .. versionchanged:: 1.1 267 Previous versions of Django only accepted strings representing import paths. 268 263 269 include 264 270 ------- 265 271