title: How to upload a image using Ajax in django
body: <p>Background :
  I have a simple model form with a image field. </p>
  
  <pre><code>class XYZForm(ModelForm):
      class Meta:
          model = XYZ
          fields = ( 'file',)
  </code></pre>
  
  <p>The model is </p>
  
  <pre><code>class XYZ(models.Model):
      url = models.URLField(null = True)
      file = models.ImageField(upload_to=get_photo_storage_path, null = True)
  </code></pre>
  
  <p>Problem:
  I am submitting this form via ajax. But this form is not validating, as the file is not being stored.Is there a particular way of submitting forms with files via ajax ?</p>
  
  <p>P.S. :- request.FILES is empty in the view, where the form is being submitted</p>