code: def respond(request, code):
      
      redirect = request.GET.get('next', request.POST.get('next'))
      if redirect:
          return HttpResponseRedirect(redirect)
      return type('Response%d' % code, (HttpResponse, ), {'status_code': code})()
docs: Responds to the request with the given response code.
      If ``next`` is in the form, it will redirect instead.