title: Redirecting after AJAX post in Django
body: <p>I use Django's built-in DeleteView and I've assigned a value to the <code>success_url</code> attribute. Now in my template, I trigger this view via JQuery' $.post() method. When the item is deleted, I don't get redirected to the <code>success_url</code>. After some search, I found that it seems to be a problem of AJAX post method, which ignores the redirection.</p>
  
  <p>I fixed it by adding a function to set the <code>window.location="#myRedirectionURL"</code> as the third parameter of <code>$.post()</code> in JQuery.</p>
  
  <p>However, this way seems not very Django. Essentially, it solves the problem from the aspect of AJAX, instead of Django. What's more, it leaves the <code>success_url</code> in DeleteView useless( But you still have to assign a value to <code>success_url</code>, or Django will raise an error). </p>
  
  <p>So is it the right way to get redirected when you post via AJAX? Is there any better way to do it?</p>
  
  <p>Thanks very much.</p>