Hugo Osvaldo Barrera
unread,Aug 11, 2015, 11:18:17 PM8/11/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
I've an app where files are uploaded to differente storages:
Certain files uploaded via de the admin are uploaded to S3 (and served
via a CDN) (using a storage from django-storages).
Other files (user-uploaded files), are saved into into our local storage
(using the default FileField storage). These are served by nginx, since
they're usually only served between 0 and 2 times.
In other words, I have:
image = ImageField(
upload_to='media/', height_field='height', width_field='width'
)
And:
catalog_photo = ImageField(
storage=S3BotoStorage(),
)
I also need to show these files in different templates (and need the
admin to show the properly too!).
If I set MEDIA_URL to point to where I upload the first group, them URLs
for the second are broken, and viceversa.
How can I deal with this? Does the field have anything I can set that I
missed?
Also, how can I avoid this breaking in the admin, where editing the
template would be quite a bit more effort (that I'd like to avoid)?
Thanks,
--
Hugo Osvaldo Barrera