示例#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})