コード例 #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
ファイル: handlers.py プロジェクト: adamnfish/djanjinja
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
ファイル: views.py プロジェクト: adamnfish/djanjinja
def plain(request):
    """Renders a template with no context directly to a response."""

    return render_to_response('plain.txt')
コード例 #4
0
ファイル: views.py プロジェクト: adamnfish/djanjinja
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
ファイル: views.py プロジェクト: adamnfish/djanjinja
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
ファイル: views.py プロジェクト: adamnfish/DjanJinja2
def plain(request):
    """Renders a template with no context directly to a response."""
    
    return render_to_response('plain.txt')
コード例 #7
0
ファイル: views.py プロジェクト: adamnfish/DjanJinja2
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
ファイル: views.py プロジェクト: adamnfish/DjanJinja2
def context(request):
    """Renders a template with a context directly to a response."""
    
    return render_to_response('context.txt', {'a': 1, 'b': 2})