Skip to main content

A django application to resize images using the thumbor service

Project description

A django application to resize images using the thumbor service.

Usage

Both thumbor_url templatetag and the generate_url helper uses the same arguments as libthumbor, you can check the wiki for more info.

On templates:

{% load thumbor_tags %}
<img src="{% thumbor_url '/media/image.jpg' width=300 %}" width="300" />

On code:

from django_thumbor import generate_url
resized = generate_url("/media/image.jpg", width=300)

Installation

pip install django-thumbor

Configuration

Add the app to the INSTALLED_APPS and the optional settings:

INSTALLED_APPS = (
    'django_thumbor',
)

Here are the default settings that you can override:

# The host serving the thumbor resized images
THUMBOR_SERVER = 'http://localhost:8888'

# The prefix for the host serving the original images
# This must be a resolvable address to allow thumbor to reach the images
THUMBOR_MEDIA_URL = 'http://localhost:8000/media'

# The same security key used in the thumbor service to
# match the URL construction
THUMBOR_SECURITY_KEY = 'my-security-key'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-thumbor-0.1.tar.gz (2.1 kB view details)

Uploaded Source

File details

Details for the file django-thumbor-0.1.tar.gz.

File metadata

File hashes

Hashes for django-thumbor-0.1.tar.gz
Algorithm Hash digest
SHA256 cce0e11d2101c62d27705f9ca4b912c9c9589e45493128e2076c484d11655140
MD5 0b44910d2a8be705ea7b2cd67b92ac59
BLAKE2b-256 76bf5a8b5f5be47569426350eaecb11f2ae6a41d9101a63ea4bd18ff1440ce5d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page