def handler404(request, template_name='404.html'): t = get_template(template_name) ctx = Context({}) return HttpResponseNotFound(t.render(ctx))