This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This is a plugin over standard sorl-thumbnails that constrains your thumbnail creation to only a set of pre defined sizes.

Define your thumbnail sizes in your settings:

'small_cropped': {
'size': (50, 50),
'options': {
'crop': 'center'
'small': {
'size': (50, 50),
'medium': {
'size': (350, 350),
'medium_cropped': {
'size': (350, 350),
'options': {
'crop': 'center'

Add to your `INSTALLED_APPS` **before** `sorl.thumbnail`


This is important so the `{% thumbnail %}` template tag gets overriden by the new one.


This app provides two template tags `{% dthumbnail %}` and overrides the standard `{% thumbnail %}` so it now takes the named thumbnails instead of arbitrary arguments.

In your templates now do:

{% load thumbnail %}

{% block content %}
{% thumbnail object.pic_field "medium" as thumb %}
<img src="{{thumb.url}}"/>
{% endthumbnail %}

{% endblock %}

You can also keep using the standard syntax:

{% thumbnail object.pic_field "350x350" crop="center "as thumb %}

as long as the parameters entered match any of the defined sizes.

When using strict mode the template tags will raise a syntax error if the parameters don't match the named thumbnails, otherwise they will only get logged.

Alternatively you can use the `{% dthumbnail %}` tag which works like the overriden `{% thumbnail %}` tag but will always be strict. This tag also takes `{% empty %}` and closes with `{% endthumbnail %}`.


By default, the new template tag will allow you to continue using old geometries not defined in `SORL_DEFINED_THUMBNAILS`.
If you want to raise errors with this, set `SORL_DEFINED_STRICT` to `True`.

Finding all template occurences

./ thumbnail_tags find_bad

Will show all the occurences of the `{% thumbnail %}` tag in your templates.

Finding all templates to convert

This app comes with a management command that will look in all app dirs and template dirs for matches of the thumbnail tag.

./ thumbnail_tags find_bad

It will print all usages of the `{% thumbnail %}` tag in your templates

Suggest which sizes to define

./ thumbnail_tags suggest_sizes

Will run a tally of all the `{% thumbnail %}` tags found in your templates and show you the occurences for each combination of geometry/options.

This should help you find which sizes to create in order to make the least changes in your templates.
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting