Use webpack dev proxy to serve api/media

This commit is contained in:
Eliot Berriot 2018-02-18 14:29:35 +01:00
commit 50af04345b
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
4 changed files with 17 additions and 9 deletions

View file

@ -31,10 +31,7 @@ class TrackFileSerializer(serializers.ModelSerializer):
fields = ('id', 'path', 'duration', 'source', 'filename', 'track')
def get_path(self, o):
request = self.context.get('request')
url = o.path
if request:
url = request.build_absolute_uri(url)
return url