由于PIL或Pillow而未生成缩略图?

时间:2013-12-29 21:05:35

标签: python django python-imaging-library virtualenv pillow

我通过管理员上传图片时没有生成缩略图(我正在使用Django)。 我认为这是PIL或Pillow的问题,但我不确切知道是什么(我认为我正在使用两者,不确定,因为我正在使用其他应用程序)。

如何正确卸载和重新安装(或进行配置)PIL和/或Pillow以便生成缩略图? (我正在使用virtualenv)

编辑:这是我从Django收到的错误(追溯)。

Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/home/family/.virtualenvs/virenv/local/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 68, in __call__
    return super(StaticFilesHandler, self).__call__(environ, start_response)
  File "/home/family/.virtualenvs/virenv/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 206, in __call__
    response = self.get_response(request)
  File "/home/family/.virtualenvs/virenv/local/lib/python2.7/site-packages/mezzanine/core/management/commands/runserver.py", line 15, in get_response
    return serve(request, path, document_root=settings.STATIC_ROOT)
  File "/home/family/.virtualenvs/virenv/local/lib/python2.7/site-packages/django/views/static.py", line 55, in serve
    raise Http404(_('"%(path)s" does not exist') % {'path': fullpath})
Http404: "media/product/.thumbnails/img_name" does not exist

1 个答案:

答案 0 :(得分:1)

从我的观点来看,代码中的某个人写了

os.path.join(thumbnail_folder, 'img_name')

而不是

os.path.join(thumbnail_folder, img_name)
你可以尝试寻找这样的错误吗?专注于'img_name'