title: Django ModelForm with Ajax avoid page refresh
body: <p>I am new in django and ajax .I have done research but most results  i found where hard to understand for me to use in my project . </p>
  
  <p>Bellow is my html code  of my form </p>
  
  <pre><code>     &lt;form action='' method="post" enctype='multipart/form-data'&gt;
          {% csrf_token %} {{ form.as_p }}
  
          &lt;button type="submit"&gt;Save changes&lt;/button&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>Here is my view.py  which i  am passing two modelforms in to same template</p>
  
  <pre><code>def DetailMfg(request,slug):
      instance=get_object_or_404(ManufacturerProfile,slug=slug)
      form =UpdateManufacturerLogo(request.POST or None ,request.FILES,instance=instance)
      form1 = UpdateManufacturerBackgroundprofileForm(request.POST ,request.FILES,instance=instance)
      if request.method == 'POST':
         if form1.is_valid() and form.is_valid():
            instances = form1.save(commit=False)
            instances1 = form.save(commit=False)
            instances1.save()
            instances.save()
  
  
         else:
            form=UpdateManufacturerBackgroundprofileForm(instance=instance)
            form =UpdateManufacturerBackgroundprofileForm(instance=instance)
  
      context={'instance':instance,
           'distributorprofile':distributorprofile,
           'form':form,
           'form1':form1}
      template_name="gbiz1990/User_function_pages/User_company_info_pages/user_mfgprofile_home.html"
      return render(request,template_name,context)
  </code></pre>
  
  <p>my url </p>
  
  <pre><code> url(r'^manufacturer_view_profile/(?P&lt;slug&gt;[\w-]+)/$',views.DetailMfg,name="mfgdetail"),
  </code></pre>
  
  <p>My problem is , which will be best possible way of creating an Ajax function preventing page reload when ever i submit one of the forms in the template, And how will my view look like to accept ajax funtion or data from ajax while preventing page reload  .Note i am having more than one django modelform in same template .Thanks in advance . </p>
  
  <p>Here is my model</p>
  
  <pre><code>class ManufacturerProfile(models.Model):
      title = models.CharField(choices=ManufacturerType,max_length=250,blank=False,null=True)
     TypeOfDistributorPrefered =MultiSelectField(choices=Distributortype,null=True,blank=False,max_choices=5)
      verified = models.BooleanField(default=False)
      logo =models.ImageField(upload_to="mfg_logo",null=True,blank=False)
      backgroundimage=models.ImageField(upload_to="mfg_logo",null=True,blank=False)
      slug = models.SlugField(default='page-slug',unique=True)
      promot=models.BooleanField(default=False)
      user =models.ForeignKey(User,unique=True,null=True,on_delete=models.CASCADE)
  </code></pre>