title: Django save base64 string to filesystem using models.ImageField
body: <p>I am trying to upload image to file system using python django. I dont have any idea on how to proceed further.</p>
  
  <p>in my model.py:</p>
  
  <pre><code>Class Test(object):
      mission = models.TextField(blank=True)
      image = models.ImageField(upload_to='documents/images/',blank=True)
      account = models.OneToOneField(Account, related_name='account')
  </code></pre>
  
  <p>in my view.py</p>
  
  <pre><code>def add_image(request, account):
      req = get_request_json(request)
      data = Test.objects.add_image(account, req)
  </code></pre>
  
  <p>in my manager.py</p>
  
  <pre><code>Class TestManager(models.Manager):
      def add_image(self, account, input):
          acc = self.get(account=account)
          acc.save()
  
          return acc;
  </code></pre>
  
  <p>But I am not sure how to proceed from here.</p>
  
  <p>I would like to know how to save the base64 image string to the specified location and store the path/file name in database?</p>
  
  <p>I have worked with python where I write the files to a directory and get the path and store in db. Here I want to use the django options.</p>
  
  <p>I have to repeat the same process with other file formats too.</p>