title: Django REST Framework and FileField absolute url
body: <p>I've defined a simple Django app that includes the following model:</p>
  
  <pre><code>class Project(models.Model):
      name = models.CharField(max_length=200)
      thumbnail = models.FileField(upload_to='media', null=True)
  </code></pre>
  
  <p>(Technically yes, that could have been an ImageField.)</p>
  
  <p>In a template, it's easy enough to include the MEDIA_URL value (duly coded in settings.py) as a prefix to the thumbnail URL.  The following works fine:</p>
  
  <pre><code>&lt;div id="thumbnail"&gt;&lt;img src="{{ MEDIA_URL }}{{ current_project.thumbnail }}" alt="thumbnail" width="400" height="300" border="0" /&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Using DRF, I've defined a HyperlinkedModelSerializer descendant called ProjectSerializer:</p>
  
  <pre><code>class ProjectSerializer(serializers.HyperlinkedModelSerializer):
  
      class Meta:
          model = Project
          fields = ( 'id' ,'url', 'name', 'thumbnail')
  </code></pre>
  
  <p>And I've defined a very straightforward ModelViewSet descendant:</p>
  
  <pre><code>class ProjectViewSet(viewsets.ModelViewSet):
      queryset = Project.objects.all()
      serializer_class = ProjectSerializer
  </code></pre>
  
  <p>A sample of the resulting JSON looks like this:</p>
  
  <pre><code>{
      "id": 1, 
      "url": "http://localhost:8000/api/v1/projects/1/", 
      "name": "Institutional", 
      "thumbnail": "media/institutional_thumb_1.jpg"
  }
  </code></pre>
  
  <p>I have not yet been able to figure out how to provide a thumbnail field that includes the full url to the image in my project's JSON representation.</p>
  
  <p>I would think that I would need to create a custom field in the ProjectSerializer, but have not been successful.</p>