def server_error(request, template_name='500.html'): """ 500 (server error) handler which uses Jinja2 to render the template. The default template is ``500.html``, and it will be rendered with a completely empty context. This is to prevent further exceptions from being raised. """ return render_to_response(template_name)
def server_error(request, template_name="500.html"): """ 500 (server error) handler which uses Jinja2 to render the template. The default template is ``500.html``, and it will be rendered with a completely empty context. This is to prevent further exceptions from being raised. """ return render_to_response(template_name)
def plain(request): """Renders a template with no context directly to a response.""" return render_to_response('plain.txt')
def req_context(request): """Renders a template with a ``RequestContext`` directly to a response.""" return render_to_response('req_context.txt', context_to_dict(RequestContext(request)))
def context(request): """Renders a template with a context directly to a response.""" return render_to_response('context.txt', {'a': 1, 'b': 2})