7👍
sorl thumbnail is now created with remote slow storages in mind. The first creation of the thumbnail is however done quering the storage, for example first accessed from template, but after that the references are cached in a key value store. Still you need the first query and creation, well one solution is to use the low level api sorl.thumbnail.get_thumbnail with the same options when the image is uploaded. When the image uploaded add this thumbnail creation job to a que like celery.
3👍
You can use Sorlery. It combines sorl and celery to create thumbnails via workers. It’s very careful not to do any filesystem access outside of the worker thread.
The thumbnail returned immediately (before the worker has had a chance) can be controlled by setting your THUMBNAIL_DUMMY_SOURCE
to an appropriate placeholder.
The job is created the first time the thumbnail is requested, subsequent requests are served the dummy image until the worker thread completes.
1👍
Almost same as @Aidan’s solution, I have made some tweaks on sorl-thumbnail. I also pre-generate thumbnails with celery. My code is here sorl_thumbnail-async
But I came to know easy_thumbnails does exactly what I was trying to do, so I am using it in my current project. You might find useful, short post on the topic is here
- Protocol error, got "H" as reply type byte
- Django queryset __contains case sensitive?
- How to access current user in Django class based view
- AWS Elastic Beanstalk Container Commands Failing
- Django: Built-in include tag vs custom inclusion tag
1👍
The easiest solution I’ve found so far is actually this third party service: http://cloudinary.com/
- Django: Duplicated logic between properties and queryset annotations
- Get a list of python packages used by a Django Project
- Cannot import name HttpResponse