title: django bootstrap modal form redirect on validation failed
body: <p>I have Bootstrap Modal which contains form. When validation form is failed redirect to the original form page. The question is how to make that server send me response with errors in my bootstrap modal?</p>
  
  <p>urls.py</p>
  
  <pre><code>url(r'^add/$', CreateCarView.as_view(), name='add_auto'),
  </code></pre>
  
  <p>views.py </p>
  
  <pre><code>class CreateCarView(CreateView):
  model = Car
  template_name = 'automobiles/automobiles_add.html'
  fields = '__all__'
  
  def get_success_url(self):
      messages.success(self.request, 'Авто успішно додано')
      return reverse('home')
  
  def post(self, request, *args, **kwargs):
      if request.POST.get('cancel_button'):
          messages.info(self.request, 'Додавання відмінено')
          return HttpResponseRedirect(reverse('home'))
      else:
          return super(CreateCarView, self).post(request, *args, **kwargs)
  </code></pre>
  
  <p>base.html</p>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;div class="col-xs-4"&gt;
          &lt;button type="button" class="btn btn-warning" data-toggle="modal" data-target="#myModal"
                  data-remote="{% url 'add_auto' %}"&gt;
              Open Modal
          &lt;/button&gt;
          &lt;div id="myModal" class="modal fade" role="dialog"&gt;
              &lt;div class="modal-dialog modal-sm"&gt;
                  &lt;!-- Modal content--&gt;
                  &lt;div class="modal-content"&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>automobiles_add.html</p>
  
  <pre><code>&lt;form id="add_item" class="form" role="form" action="{% url 'add_auto' %}" method="post"&gt;
  &lt;div class="modal-header"&gt;
      &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;×&lt;/button&gt;
      &lt;h4 class="modal-title"&gt;Додати авто&lt;/h4&gt;
  &lt;/div&gt;
  &lt;div class="modal-body"&gt;
      {% csrf_token %}
      {{ form.as_p }}
  &lt;/div&gt;
  &lt;div class="modal-footer"&gt;
      &lt;input class="btn btn-success" type="submit" value="Додати тачку" name="add_button"&gt;
      &lt;input class="btn btn-danger" type="submit" value="Відмінити" name="cancel_button"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>