title: Can't display image on browser with django rest framework
body: <p>I've a problem similar to this <a href="https://stackoverflow.com/questions/35890814/not-able-to-get-image-from-django-rest-api">SO post</a>, but none of its answers helped me to solve my issue.</p>
  
  <p>Here we are : I'm able to save an image on the server but not able to get Image from API image hyperlink.</p>
  
  <p>My files :</p>
  
  <p>model.py</p>
  
  <pre><code>class Summary(models.Model):
  
      question_text = models.CharField(max_length=255)
      created_at = models.DateTimeField(auto_now_add=True)
      cover_image = models.ImageField(upload_to='cover_image/', max_length=255)
      userProfileSummary = models.ManyToManyField(UserProfile, through='UserProfileSummary')
  
      def __str__(self):
          return self.question_text
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>class Summary(models.Model):
  
      question_text = models.CharField(max_length=255)
      created_at = models.DateTimeField(auto_now_add=True)
      cover_image = models.ImageField(upload_to='cover_image/', max_length=255)
      userProfileSummary = models.ManyToManyField(UserProfile, through='UserProfileSummary')
  
      def __str__(self):
          return self.question_text
  </code></pre>
  
  <p>serializer.py</p>
  
  <pre><code>class SummarySerializer(serializers.ModelSerializer):
      """A serializer for summary item"""
      cover_image = serializers.ImageField(max_length=None, use_url=True)
  
      class Meta:
          model = models.Summary
          exclude = ('userProfileSummary',)
  </code></pre>
  
  <p>settings.py</p>
  
  <pre><code>STATIC_URL = '/static/'
  
  STATICFILES_DIRS =(
      os.path.join(BASE_DIR, 'static'),
      '/static',
  )
  
  MEDIA_URL = '/media/'
  MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  </code></pre>
  
  <p>urls.py </p>
  
  <pre><code>from django.urls import path, include
  from rest_framework.routers import DefaultRouter
  from django.conf.urls.static import static
  from django.conf import settings
  from . import views
  
  router = DefaultRouter()
  router.register('Hello-viewset', views.HelloViewSet, base_name='hello-viewset')
  
  urlpatterns= [
      path('hello-view/', views.HelloApiView.as_view()),
      path('UserProfileSummary/&lt;int:id&gt;/', views.UserProfileSummaryViewSet.as_view()),
      path('', include(router.urls))
  ]+static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
  </code></pre>
  
  <p>App structure :</p>
  
  <pre><code>- myproject/
   - cover_image/
   - media/
   - myproject_api/
    - models.py
    - serializers.py
    - ...
    - myproject/
     - settings.py
     - ...
  </code></pre>
  
  <p>And also, my main urls.py file (myproject/urls.py)</p>
  
  <pre><code>from django.contrib import admin
  from django.urls import path, include
  from django.conf import settings
  
  urlpatterns = [
      path('admin/', admin.site.urls),
      path('api/', include('myproject_api.urls'))
  ]
  </code></pre>
  
  <p>I can Make a Request For POST successfully &amp; It show correct image link but when i click on image link it gives error.</p>
  
  <p><a href="https://i.stack.imgur.com/tjloT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tjloT.png" alt="enter image description here"></a></p>
  
  <p>What's wrong ? </p>
  
  <p>Please help !</p>