From ea76dc18b6770aefcc53a6c5752674c2fff0ddcf Mon Sep 17 00:00:00 2001 From: Tymur Maryokhin Date: Thu, 6 Nov 2014 18:20:55 +0100 Subject: [PATCH] Fixed base_url duplication in FileField.use_url Django already joins base_url when constructing FileField.url --- rest_framework/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 71377326f..95cda2ced 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1007,7 +1007,7 @@ class FileField(Field): if self.use_url: if not value: return None - url = settings.MEDIA_URL + value.url + url = value.url request = self.context.get('request', None) if request is not None: return request.build_absolute_uri(url)