Exemplo n.º 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))
Exemplo n.º 2
0
def handler500(request):
  return handler(
      "500.html",
      Context(default_template_dict(request)),
      http.HttpResponseServerError)
Exemplo n.º 3
0
def handler404(request):
  return handler(
      "404.html",
      RequestContext(request, default_template_dict(request)),
      http.HttpResponseNotFound)
Exemplo n.º 4
0
def handler403(request):
  return handler(
      "403.html",
      RequestContext(request, default_template_dict(request)),
      http.HttpResponseForbidden)
Exemplo n.º 5
0
def handler400(request):
  return handler(
      "400.html",
      Context(default_template_dict(request)),
      http.HttpResponseBadRequest)