示例#1
0
    def wrapper(request, *args, **kw):
      output = func(request, *args, **kw)
      if not isinstance(output, dict): return output

      return render_to_response(
        template_name,
        default_template_dict(request, output, title),
        context_instance=RequestContext(request))
示例#2
0
def handler500(request):
  return handler(
      "500.html",
      Context(default_template_dict(request)),
      http.HttpResponseServerError)
示例#3
0
def handler404(request):
  return handler(
      "404.html",
      RequestContext(request, default_template_dict(request)),
      http.HttpResponseNotFound)
示例#4
0
def handler403(request):
  return handler(
      "403.html",
      RequestContext(request, default_template_dict(request)),
      http.HttpResponseForbidden)
示例#5
0
def handler400(request):
  return handler(
      "400.html",
      Context(default_template_dict(request)),
      http.HttpResponseBadRequest)