[Solved]-When I use HttpResponseRedirect I get TypeError: quote_from_bytes() expected bytes in Django


get_success_url doesn’t return an HttpResponseRedirect instead it should return the url you want to redirect to. So you can just return reverse('index'):

def get_success_url(self):
    return reverse('index')


A shortcut for HttpResponseRedirect is redirect(“View_name”)
it returns an HttpResponse (HTML)

Reverse returns a url

Leave a comment