@requires_csrf_token
def bad_request(request, template_name='400.html'):
 try:
  template = loader.get_template(template_name)
 except TemplateDoesNotExist:
  return http.HttpResponseBadRequest('<h1>Bad Request (400)</h1>', content_type='text/html')
 return http.HttpResponseBadRequest(template.render(Context({})))

@ requires_csrf_token def bad_request ( request , template_name = '400.html' ) : try : template = loader . get_template ( template_name ) except TemplateDoesNotExist : return http . HttpResponseBadRequest ( '<h1>Bad Request (400)</h1>' , content_type = 'text/html' ) return http . HttpResponseBadRequest ( template . render ( Context ( { } ) ) )
raise 400 httpbadrequest error .