Search code examples
djangodjango-modelsdjango-adminsorl-thumbnail

sorl-thumb doesn't make thumbnails


I don't know what I'm doing wrong, but sorl-thumb just uploads the image but doesn't make thumbs...

model.py

 from sorl.thumbnail.fields import ImageWithThumbnailsField ,ThumbnailField

 imagen = ImageWithThumbnailsField(upload_to='images',
                                      thumbnail={'size': (75, 75)},
                                      extra_thumbnails={'icon': {'size': (25, 25),'options': ['crop', 'upscale']},
                                                        'large': {'size': (200, 400)},
                                                        },
                                    )

setting

'sorl.thumbnail',

What more do I need? I've followed the documentation.


Solution

  • Did you read the documentation on when thumbnails are created?

    You haven't actually explained exactly what your problem is. Edit your original question to show something you are trying to do (along with both the actual and expected results).

    EDIT: As the docs say, your images are not created until they are used. If you want thumbs to be generated when the image is initially uploaded, use the generate_on_save attribute like this:

    ImageWithThumbnailsField(..., generate_on_save=True)