sorl-thumbnail
Thumbnails for Django
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-thumbnailuv
uv add sorl-thumbnailpoetry
poetry add sorl-thumbnailInstalling 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
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
django-versatileimagefieldExtends Django's ImageField with flexible image…
permissive · top 15,000 on PyPI
easy-thumbnailsGenerates and manages thumbnail images for…
permissive · top 15,000 on PyPI
libthumborlibthumbor generates encrypted URLs for the…
permissive · top 15,000 on PyPI
django-imagekitAutomated image processing for Django…
permissive · top 15,000 on PyPI
WillowWillow provides a unified API for image…
permissive · top 5,000 on PyPI
django-cleanupAutomatically deletes old files when Django…
permissive · top 15,000 on PyPI
pyobjc-framework-QuickLookThumbnailingProvides Python bindings to macOS's…
permissive · top 15,000 on PyPI
pillowPillow adds image processing capabilities to…
permissive · top 100 on PyPI
django-embed-videoProvides Django template tags and model fields…
permissive · top 15,000 on PyPI
django-tastypiedjango-tastypie provides a REST API framework…
permissive · top 15,000 on PyPI