Esempio n. 1
0
def e400(request, **kwargs):
    """400 handler"""
    message = kwargs.get('message', '')
    request.LANGUAGE_CODE = get_language(request)
    return HttpResponseBadRequest(
        render_to_string('errors/400.html', {
            'request_path': request.path,
            'message': message,
            'is_error_page': True
        },
                         request=request,
                         using='jinja2'))
Esempio n. 2
0
def e404(request, exception, *args, **kwargs):
    """404 handler"""
    message = kwargs.get('message', '')
    request.LANGUAGE_CODE = get_language(request)
    return HttpResponseNotFound(
        render_to_string(
            'errors/404.html', {
                'request_path': request.path,
                'message': message,
                'is_error_page': True
            },
            request=request,
            using='jinja2'
        )
    )