I am having a very strange error in using sorl thumbnails in my django project which uses S3 for media files. I have done my settings as pointed out in this answer https://mcmap.net/q/1013679/-how-do-i-use-django-sorl-thumbnail-memcached-and-s3-together and in fact all my other media files are being generated correctly.
But for the images generated through sorl thumbnails I am getting a url like this
The problem is strange because its appending the S3 storage path to the image url, but its not adding /media/ in between. If you check
https://he-s3.s3.amazonaws.com/media/cache/6f/cb/6fcb83175cb63f754fba9facec5dda7f.jpg
the image actually exists there, but since the url is being generated wrong, I am getting a broken image. In the settings file I have declared the DEFAULT_FILE_STORAGE using s3boto and it contains
S3_URL = 'http://he-s3.s3-website-ap-southeast-1.amazonaws.com'
MEDIA_URL = S3_URL + '/media/'
I fail to understand why does the path in the sorl thumbnail image not contain media.
Any help is appreciated.
Update
Instead of being solved, the problem has in fact compounded. What I did was that I cleared the KVStore in thumbnail and all the database was cleared. I was happy because I thought the problem was solved, I was getting the correct url now. But then I refreshed the page, and again I was getting the wrong url. I don't understand what's happening, if I clear the thumbnail db, it shows the correct url once and after that it again shows the wrong url.