django-imagekit教程失败 - 不创建缩略图

时间:2011-06-08 21:38:05

标签: django django-imagekit

我根据this tutorial尝试过,但失败了。我已经复制了所有内容完全,就像在教程中一样。问题是ImageKit没有创建缩略图(显示和缩略图)。

以下是一些细节:

>>> from myapp.models import Photo
>>> p = Photo.objects.all()[0]
>>> p.original_image.url
'photos/lena.jpg'
>>> p.display.url
Traceback (most recent call last):
  File "<console>", line 1, in <module>
AttributeError: 'Photo' object has no attribute 'display'
>>> p.thumbnail_image.url
Traceback (most recent call last):
  File "<console>", line 1, in <module>
AttributeError: 'Photo' object has no attribute 'thumbnail_image'

1 个答案:

答案 0 :(得分:2)

您应该考虑使用PIL创建缩略图: http://www.pythonware.com/products/pil/

非常易于使用,并且易于学习: http://effbot.org/imagingbook/image.htm