0

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

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

编辑:这是我从 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
4

1 回答 1

1

从我的角度来看,有人写的代码中的某个地方

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

代替

os.path.join(thumbnail_folder, img_name)

你能试着寻找这样的错误吗?专注于'img_name'

于 2013-12-31T08:59:28.787 回答