django-localdevstorage
django-localdevstorage copied to clipboard
Make sure the MEDIA_URL setting is respected when building urls
Just a little fix so that the MEDIA_URL setting is respected (again).
@anrie thanks for your pull request, and sorry for the slow response! Can you give a quick example (or even better, a test ☺️) what case this fixes?
@piquadrat I hope this test illustrates the issue.
I am basically reverting/correcting this change (https://github.com/piquadrat/django-localdevstorage/commit/c7045d2ed8a21403978b1a3fe7b4dc32b84fe245#diff-c9df30405b26cdf3aad319072b358fe7R37).
The _url-method introduced in this change behaves slightly different than Django's url-method (https://github.com/django/django/blob/master/django/core/files/storage.py#L312), that it replaces. Not sure if this change happened intentionally or accidentally.
After c7045d2 the MEDIA_URL setting is ignored when constructing the urls and so I see broken urls and consequently no files are downloaded.
Yeah, I'm seeing this as well. URLs lack the /media/ part, and because of this all media file access fails.
Hi, Will this ever go in, or would the best way be for me to merge myself?
Sorry for the plug, but if you're only using HTTP you might want to switch to https://github.com/matthiask/django-http-fallback-storage.
(Related: https://twitter.com/suppensud/status/769102478918942720)
Awesome, thanks @matthiask