code: def bad_request(request, template_name='400.html'):
      
  
      response = render_in_page(request, template_name)
  
      if response:
          return response
  
      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({})))
docs: 400 error handler.
  
      Templates: :template:`400.html`
      Context: None