You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a catch when using S3 as your storage backend - saving and retrieving photos works as you would expect, but when trying to clear the cache folder (for example after rotating the photo) and maybe in some other cases, _get_SIZE_filename() is called, and that in turn returns a path based on MEDIA_ROOT - causing a SuspiciousOperation at least in Django 1.4 and above.
There's a catch when using S3 as your storage backend - saving and retrieving photos works as you would expect, but when trying to clear the cache folder (for example after rotating the photo) and maybe in some other cases,
_get_SIZE_filename()
is called, and that in turn returns a path based on MEDIA_ROOT - causing a SuspiciousOperation at least in Django 1.4 and above.The code in issue is in
photologue/models.py
:For my use case, where I needed to be able to delete cached sized versions of images, overriding the
_get_SIZE_filename
method with something likebut there should be a better way of dealing with this in an storage independent kind of way.
The text was updated successfully, but these errors were encountered: