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

23👍

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')
👤nmu

0👍

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

Reverse returns a url

Leave a comment