skillfed

sorl-thumbnail

Thumbnails for Django

sorl-thumbnail v13.0.0 524.4K downloads/30d#6,190 on PyPI1,795
Permissive license Copyright (c) 2010, Mikko Hellsing All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:… (full text in the JSON record) Active released

What it is and what it does

sorl-thumbnail is a Django app that generates, caches, and serves image thumbnails on demand. It abstracts the thumbnail generation pipeline behind a simple template tag and Python API, letting you specify dimensions, cropping strategy, and quality once and reuse them across your site. The package supports multiple image processing engines (Pillow, ImageMagick, Wand, pgmagick, vipsthumbnail) and storage backends (filesystem, S3, Redis, DynamoDB), so you can swap implementations without changing your code.

The core workflow is straightforward: you request a thumbnail at a given size and crop mode, sorl-thumbnail generates it if it doesn't exist, caches the result in a key-value store (database, Redis, or DynamoDB), and returns the URL. It handles admin integration, placeholder generation, smart cropping with border removal, and alternative resolutions. The package is actively maintained by the Jazzband community, supports current Django and Python versions, and has no runtime dependencies—you only install the image engine you need.

Use it for:

  • Generate responsive image thumbnails in Django templates without writing image processing code.
  • Cache thumbnails in Redis or DynamoDB to avoid regenerating them on every request.
  • Serve thumbnails from cloud storage (S3) with smart cropping and multiple resolution variants.
  • Automatically delete cached thumbnails when an ImageField is removed from a model.
  • Swap image processing engines (Pillow to ImageMagick) by changing a setting, not code.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Generates and caches image thumbnails for Django applications, with pluggable support for multiple image engines and storage backends.

Yes. sorl-thumbnail is a mature, actively maintained solution for a common Django need. It has no runtime dependencies, low install friction, permissive licensing, and zero known vulnerabilities. Install it if you need thumbnail generation in a Django project and want a pluggable, battle-tested approach. The only gotcha is ensuring your chosen image engine and its system dependencies are installed separately.

Install

sorl-thumbnail on PyPI

pip

pip install sorl-thumbnail

uv

uv add sorl-thumbnail

poetry

poetry add sorl-thumbnail

Installing sorl-thumbnail

Before you install

Low install friction with no runtime dependencies. Active maintenance with recent commits and a Jazzband community project backing it. Supports current Django versions (4.2, 5.0, 5.1, 5.2) and modern Python (3.10–3.13).

License in practice

BSD license (permissive). You may use, modify, and distribute sorl-thumbnail freely in commercial and private projects, provided you retain the copyright notice and disclaimer.

Quickstart

pip install sorl-thumbnail

# In Django settings.py, add to INSTALLED_APPS:
INSTALLED_APPS = [
    'sorl.thumbnail',
]

# In a template:
{% load thumbnail %}
{% thumbnail item.image "100x100" crop="center" as im %}
  <img src="{{ im.url }}" alt="">
{% endthumbnail %}

# Or in Python:
from sorl.thumbnail import get_thumbnail
im = get_thumbnail(my_file, '100x100', crop='center', quality=99)

Requires Django 4.2 or later and Python 3.10 or later. An image processing engine (Pillow, ImageMagick, Wand, etc.) must be installed separately and configured.

Verify before relying

  • Whether the package's performance on cloud storage (S3, etc.) meets your latency requirements without the THUMBNAIL_FORCE_OVERWRITE workaround.
  • Specific compatibility with your chosen image engine (Pillow, ImageMagick, Wand, pgmagick, or vipsthumbnail) and its system dependencies.

Package facts

License Copyright (c) 2010, Mikko Hellsing All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 204 days since the last release
Last repo commit
First released
Downloads 524,380/month — #6,190 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sorl_thumbnail-13.0.0-py3-none-any.whl

Keywords: django, thumbnail, sorl

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Multimedia :: Graphics

Tags

django thumbnail generationimage resizing djangothumbnail cachingdjango image processingpillow imagemagick integrationdjango storage thumbnailssmart crop thumbnails
django-extensionimage-processingcaching

More Dynamic Content packages