-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
FileField representations should return URLs, not paths. #1368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Would like to see this, tho it's not behaviour that we can just arbitrarily change for existing users. |
I think it is an obvious requirement. When client asks server for object data, apparently wants to use them. So, only working (absolute) url of file or image is useful. |
Related discussion, but for ImageField: https://groups.google.com/d/msg/django-rest-framework/ldRP-y_s6bQ/weRniVgkynkJ |
FileField (and the ImageField) only show its name currently, rather than the storage url.
AFAIK, name is the string stored in the db; path is the MEDIA_ROOT + name; url is the MEDIA_URL + name.
Only found the same question on the ML. I think it would be convenient if we made this change.
Any thought on this?
The text was updated successfully, but these errors were encountered: