title: upload images using RESTAPI
body: <p>I am working with an app using Django Rest Framework. </p>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>class Image(models.Model):
      image_meta = models.ForeignKey('Image_Meta',on_delete=models.CASCADE,)
      image_path = models.URLField(max_length=200)
      order = models.IntegerField()
      version = models.CharField(max_length=10)
  </code></pre>
  
  <p><strong>serializers.py</strong></p>
  
  <pre><code>class ImageSerializer(serializers.ModelSerializer):
      class Meta:
          model = Image
          field = ('id', 'image_path' , 'order' , 'version')
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>class ImageList(generics.ListCreateAPIView):
      queryset = Image.objects.all()
      serializer_class = ImageSerializer
  
  class ImageDetail(generics.RetrieveUpdateDestroyAPIView):
      queryset = Image.objects.all()
      serializer_class = ImageSerializer
  </code></pre>
  
  <p><strong>url patterns</strong></p>
  
  <pre><code>url(r'^image/$',views.ImageList.as_view(),name='image_list'),
  url(r'^image/(?P&lt;pk&gt;[0-9]+)/$',views.ImageDetail.as_view(),name='image_detail')
  </code></pre>
  
  <p>This is just a part of the whole system. <strong>I want to upload images using the RESTAPI and then upload it to amazon s3 and from there get the url and store it in the <em>image_path</em> field of the model Image.</strong> I have seen previous solutions for uploading files using REST (<a href="https://www.google.co.in/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;uact=8&amp;ved=0ahUKEwjW6qX13JzLAhXQcI4KHXjyAiIQFggdMAA&amp;url=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F3938569%2Fhow-do-i-upload-a-file-with-metadata-using-a-rest-web-service&amp;usg=AFQjCNFcYQaJ8Yf9J07a42HCxtjifWa5jg&amp;bvm=bv.115339255,d.c2E">like this</a>)but nothing worked for my case. Can someone suggest how can I do that?</p>