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

    return render_to_response('plain.txt')
예제 #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)))
예제 #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})
예제 #6
0
def plain(request):
    """Renders a template with no context directly to a response."""
    
    return render_to_response('plain.txt')
예제 #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)))
예제 #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})