title: How to submit form without refreshing page using Django, Ajax, jQuery?
body: <p>I am newbie working with django. I need simple example.
  How to submit form (post) without refreshing page using Django, Ajax, jQuery?</p>
  
  <p>This is my form, views and template:</p>
  
  <p>views.py</p>
  
  <pre><code>from django.shortcuts import *
  from django.template import RequestContext
  from linki.forms import *
  
  def advert(request):
      if request.method == "POST":
          form = AdvertForm(request.POST)
  
          if(form.is_valid()):
              print(request.POST['title'])
              message = request.POST['title']
  
          else:
              message = 'something wrong!'
  
  
          return render_to_response('contact/advert.html',
                  {'message':message},
              context_instance=RequestContext(request))
  
      else:
          return render_to_response('contact/advert.html',
                  {'form':AdvertForm()},
              context_instance=RequestContext(request))
  </code></pre>
  
  <p>forms.py (form using "ModelForm")</p>
  
  <pre><code>from django import forms
  from django.forms import ModelForm
  from linki.models import Advert
  
  
  class AdvertForm(ModelForm):
      class Meta:
          model = Advert
  </code></pre>
  
  <p>TEMPLATES (form html code)</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  
  &lt;/head&gt;
      &lt;body&gt;
      &lt;h1&gt;Leave a Suggestion Here&lt;/h1&gt;
          {% if message %}
              {{ message }}
          {% endif %}
          &lt;div&gt;
              &lt;form action="" method="post"&gt;{% csrf_token %}
                  {{ form.as_p }}
                  &lt;input type="submit" value="Submit Feedback" /&gt;
              &lt;/form&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>