def server_error(request, template_name='500.html'):
    """
    500 error handler.

    Templates: :template:`500.html`
    Context: None
    """

    response = render_in_page(request, template_name)

    if response:
        return response

    try:
        template = loader.get_template(template_name)
    except TemplateDoesNotExist:
        return http.HttpResponseServerError('<h1>Server Error (500)</h1>', content_type='text/html')
    return http.HttpResponseServerError(template.render(Context({})))
def server_error ( request , template_name = '500.html' ) : response = render_in_page ( request , template_name ) if response : return response try : template = loader . get_template ( template_name ) except TemplateDoesNotExist : return http . HttpResponseServerError ( '<h1>Server Error (500)</h1>' , content_type = 'text/html' ) return http . HttpResponseServerError ( template . render ( Context ( { } ) ) )
500 error handler.

    Templates: :template:`500.html`
    Context: None