I\'ve defined a simple Django app that includes the following model:
class Project(models.Model):
name = models.CharField(max_length=200)
thumbnail =
if you cannot access extra context in your seriralizer using Viewsets, try register your router with a basename in urls.py:
router.register('projects', ProjectViewSet, basename='project')
you can use build_absolute_uri:
def get_thumbnail_url(self, obj):
return self.context.get('request').build_absolute_uri(obj.thumbnail.url)