Skip to content

Instantly share code, notes, and snippets.

View rluts's full-sized avatar

rluts rluts

  • Ukraine
View GitHub Profile
@rluts
rluts / imagewiththumbnails_updateable.py
Last active May 18, 2018 18:29 — forked from valberg/imagewiththumbnails_updateable.py
Django create thumbnail form ImageField and save in a different ImageField - now with updating!
def create_thumbnail(instance, image_field, thumb_field):
# original code for this method came from
# http://snipt.net/danfreak/generate-thumbnails-in-django-with-pil/
# https://gist.github.com/valberg/2429288
# adapted to python 3
# insert this code to utils.py