Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 697 Bytes

README.md

File metadata and controls

25 lines (20 loc) · 697 Bytes

static-thumbnails

Django application providing template tags to create thumbnails from static files using easy-thumbnails

Installation

pip install Pillow easy-thumbnails static-thumbnails

Usage

Add static-thumbnails to your settings.py:

INSTALLED_APPS = [
    # ... regular django apps go here
    'easy_thumbnails',
    'static_thumbnails',
]

And then use it as the regular thumbnail tag from easy-thumbnails, but pointing ot to a file in your STATIC_ROOT:

{% static_thumbnail 'some/static/file.png' 150x100 quality=100 HIGH_RESOLUTION as logo %}
<img src="{{ logo.highres_url }}" width="{{ logo.width }}" height="{{ logo.height }}" />