Exemple #1
0
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)
Exemple #2
0
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)
Exemple #3
0
def plain(request):
    """Renders a template with no context directly to a response."""

    return render_to_response('plain.txt')
Exemple #4
0
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)))
Exemple #5
0
def context(request):
    """Renders a template with a context directly to a response."""

    return render_to_response('context.txt', {'a': 1, 'b': 2})
Exemple #6
0
def plain(request):
    """Renders a template with no context directly to a response."""
    
    return render_to_response('plain.txt')
Exemple #7
0
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)))
Exemple #8
0
def context(request):
    """Renders a template with a context directly to a response."""
    
    return render_to_response('context.txt', {'a': 1, 'b': 2})