1
Me, too, I don’t understand your problem with generating thumbnails in the template. But if you want to create them in the view (or anywhere else in the python code), that will be possible with sorl thumbnail. In the sorl thumbnail docs, there’s the following low level api example:
from sorl.thumbnail import get_thumbnail
im = get_thumbnail(my_file, '100x100', crop='center', quality=99)
Source:stackexchange.com