showing results for - "django ajax redirect to a view on success"
Luciano
10 Sep 2017
1$.post( "{% url 'your_url' %}", 
2         { csrfmiddlewaretoken: '{{ csrf_token}}' , 
3           other_params: JSON.stringify(whatever)
4         },  
5         function(data) {
6             if(data.status == 1){ // meaning that everyhting went ok
7                // do something
8               	window.location('your_url')
9             }
10             else{
11                alert(data.message)
12                // do your redirect
13                window.location('your_url')
14             }
15        });
16
similar questions
page redirect after load