mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
Merge c57d80d2a0
into 48b66ec2a2
This commit is contained in:
commit
363c547e40
|
@ -973,6 +973,8 @@ class FileField(WritableField):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def to_native(self, value):
|
def to_native(self, value):
|
||||||
|
if api_settings.PREPEND_MEDIA_URL:
|
||||||
|
return settings.MEDIA_URL + value.name
|
||||||
return value.name
|
return value.name
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,9 @@ DEFAULTS = {
|
||||||
|
|
||||||
# Pending deprecation
|
# Pending deprecation
|
||||||
'FILTER_BACKEND': None,
|
'FILTER_BACKEND': None,
|
||||||
|
|
||||||
|
# Prepending MEDIA_URL to FileField
|
||||||
|
'PREPEND_MEDIA_URL': False,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user