[Fixed]-Redirect not able to send response

1👍

The whole point of using Ajax is that it overrides the browser navigation handling. If you want your Ajax to redirect, you need to do it in js – or, don’t use Ajax at all.

0👍

redirect either needs the relative or absolute url that you need to redirect to.
You need to use django reverse url resolver

from django.core.urlresolvers import reverse 

def func1(request):
    if not request.user.is_authenticated():
        return render(request, 'login/login/login.html')
    else:
        if request.method == "POST":
            return redirect(reverse('base:func2'))
        return render(request, 'base/home/index.html')

Leave a comment