This was ages ago but yes, as I mentioned, I simply overwrote the abstract model's get_missing_image
def get_missing_image(self): """ Returns a missing image object. """ # This class should have a 'name' property so it mimics the Django file # field. return MissingProductImage() by forking the catalogue app with a hard coded default path to a placeholder image. def get_missing_image(self): """Return a missing image object. :return: path of the image :rtype: str """ return 'media/image_not_found.jpg' On Friday, 27 April 2018 13:40:39 UTC+1, King Olami wrote: > > Were you able to fix it please. > > On Monday, July 20, 2015 at 5:14:18 PM UTC+1, IL wrote: >> >> For some reason yet unknown to me, a product's thumbnails disappear from >> view after just a single load of a page (both in Dashboard and Product >> Detail view) because the template seems to be truncating the URLs. This >> problem doesn't happen to statics at all. >> >> To replicate: >> >> 1. Upload an image for a product using the dashboard. The image gets >> stored in the correct S3 bucket, media path,is accessible by all, and so >> on. (confirmed with django admin, AWS Console and sorl debug logging) >> >> 2. System returns the correct working URL >> https://s3.amazonaws.com/mybucket/*media*/cache/XXX/YYY/ZZZ.jpg that >> works on first page view request. >> >> 3. Reload the page. System returns broken URL >> https://s3.amazonaws.com/mybucket/cache/XXX/YYY/ZZZ.jpg (missing 'media' >> path) >> >> 4. Running python manage.py thumbnail cleanup, python manage.py thumbnail >> clear, restart gunicorn takes up back to step 2 >> >> >> Am I missing something? Should I be looking at sorl.thumbnail or oscar >> templates? >> >> >> >> >> Some relevant settings and data: >> >> *Snippet from pip requirements* >> sorl-thumbnail==12.3 >> boto==2.38.0 >> django-storages==1.1.8 >> awscli==1.7.39 >> >> *Snippet from settings.py* >> THUMBNAIL_DEBUG = True >> THUMBNAIL_PRESERVE_FORMAT=True >> OSCAR_IMAGE_FOLDER = 'images/products/' >> >> AWS_STORAGE_BUCKET_NAME = 'mybucket' >> AWS_ACCESS_KEY_ID = 'mykey' >> AWS_SECRET_ACCESS_KEY = 'mysecret' >> AWS_S3_CUSTOM_DOMAIN = 's3.amazonaws.com/%s' % AWS_STORAGE_BUCKET_NAME >> >> STATICFILES_LOCATION = 'static' >> MEDIAFILES_LOCATION = 'media' >> DEFAULT_FILE_STORAGE = 'utils.MediaRootS3BotoStorage' >> STATICFILES_STORAGE = 'utils.StaticRootS3BotoStorage' >> STATIC_ROOT = location('static') >> MEDIA_ROOT = location('media') >> STATIC_URL = "https://%s/%s/" % (AWS_S3_CUSTOM_DOMAIN, >> STATICFILES_LOCATION) >> MEDIA_URL = "https://%s/%s/" % (AWS_S3_CUSTOM_DOMAIN, MEDIAFILES_LOCATION) >> >> *Entire utils.py* >> from storages.backends.s3boto import S3BotoStorage >> >> StaticRootS3BotoStorage = lambda: S3BotoStorage(location='static') >> MediaRootS3BotoStorage = lambda: S3BotoStorage(location='media') >> >> *Entire thumbnail_kvstore db* >> key >> | value >> >> --------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------- >> sorl-thumbnail||image||e14a50914a152da773157a34d30d4ab4 | >> {"storage": "storages.backends.s3boto.S3BotoStorage", "name": >> "images/products/ZZZ.jpg", "size": [2000, 3000]} >> sorl-thumbnail||image||5cab03b2ed5b48fccd2309abdddd8d7e | >> {"storage": "storages.backends.s3boto.S3BotoStorage", "name": >> "cache/ee/25/ee25c9c57c544b0eadaa892c6bd1ce84.jpg", "size": [267, 400]} >> sorl-thumbnail||thumbnails||e14a50914a152da773157a34d30d4ab4 | >> ["5cab03b2ed5b48fccd2309abdddd8d7e"] >> sorl-thumbnail||image||8a767e549b0b784968c1e5aca445532a | >> {"storage": "storages.backends.s3boto.S3BotoStorage", "name": >> "cache/60/84/608471a1fac28fb8b5c885e95d3d8797.jpg", "size": [103, 155]} >> >> >> >> >> -- https://github.com/tangentlabs/django-oscar http://django-oscar.readthedocs.org/en/latest/ https://twitter.com/django_oscar --- You received this message because you are subscribed to the Google Groups "django-oscar" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar+unsubscr...@googlegroups.com. Visit this group at https://groups.google.com/group/django-oscar. To view this discussion on the web, visit https://groups.google.com/d/msgid/django-oscar/5f217f37-6b2a-4e5d-96d0-e150b3174a4a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.