# 使用easy thumbnails轻松为图片创建缩略图

## 关于Problem的描述

The majority of applications that have images, probably use thumbnails in some capacity. There is no standard thumbnail capability in Django but there are a couple of different options out there that people have created. This page is an attempt to gather them in one place and discuss the best strategy for integrating one in Django.

## 关于easy_thumbnails

A powerful, yet easy to implement thumbnailing application for Django 1.8+ Below is a quick summary of usage. For more comprehensive information, view the full documentation online or the peruse the project's docs directory.

## 使用步骤简介

pip install easy-thumbnails


INSTALLED_APPS = (
...
'easy_thumbnails',
)

THUMBNAIL_ALIASES = {
'': {
'avatar': {'size': (50, 50), 'crop': True},
},
}


Run manage.py migrate easy_thumbnails.

{% load thumbnail %}
<img src="{{ profile.photo|thumbnail_url:'avatar' }}" alt="" />