【问题标题】:Django Satchmo No ImagesDjango Satchmo 没有图像
【发布时间】:2012-01-25 23:01:57
【问题描述】:

我使用 clonesatchmo 启动并运行了基本的 Satchmo 存储,但是图像没有显示出来。

来源显示:

<a href="/product/neat-book/"><img src="" width="" height="" /></a>

图像源应为空白。 当我运行 python manage.py satchmo_check 时,我没有收到任何错误。

我在 Mac OS X Lion 和 virtualenv 中运行 python 2.7.1。

这是我的 pip freeze > 要求:Django==1.3.1

PIL==1.1.7
PyYAML==3.10
Satchmo==0.9.2
TRML2PDF==1.0
-e hg+http://bitbucket.org/bkroeze/django-caching-app-plugins/@b0e77d2243cb5e655472a9f80581663cf59c5aa0#egg=django_caching_app_plugins-dev
-e hg+http://bitbucket.org/bkroeze/django-keyedcache/@4bf75598cab6c807d15c0dd643da2625ceb7d857#egg=django_keyedcache-dev
-e hg+http://bitbucket.org/bkroeze/django-livesettings/@68ac220849162a194fcb466de56febd100aa73a1#egg=django_livesettings-dev
django-registration==0.7
-e hg+http://bitbucket.org/bkroeze/django-signals-ahoy/@87f60574d64b9e87db3a086ee7ddea25f687a811#egg=django_signals_ahoy-dev
-e hg+http://bitbucket.org/bkroeze/django-threaded-multihost/@4aebd54035c8fbd38e4a5c5c87ff977a4740c4c2#egg=django_threaded_multihost-dev
pycrypto==2.4.1
reportlab==2.5
sorl-thumbnail==3.2.5
wsgiref==0.1.2
yolk==0.4.1

提前致谢!

【问题讨论】:

    标签: django satchmo


    【解决方案1】:
    1. 尝试运行这个来检查问题python manage.py satchmo_check

    2. 阅读本页底部关于安装数据http://www.satchmoproject.com/docs/dev/settings.html#test-and-install-the-data

    3. 您的版本与这里的不匹配:http://www.satchmoproject.com/docs/dev/new_installation.html 例如这个不同的一个(没有检查所有) easy_install http://www.satchmoproject.com/snapshots/trml2pdf-1.2.tar.gz

    我遇到了同样的问题,并且曾经遇到过

    easy_install http://www.satchmoproject.com/snapshots/trml2pdf-1.2.tar.gz
    pip install reportlab
    rm -r store
    python clonesatchmo.py
    

    效果很好。

    【讨论】:

      【解决方案2】:

      检查存储目录中的 satchmo.log 文件。如果你发现类似

      Sun, 23 Sep 2012 09:59:41 sorl.thumbnail ERROR    Thumbnail tag failed:
      Traceback (most recent call last):
        File "/home/mosta/VirtualEnv/luana/local/lib/python2.7/site-packages/sorl/thumbnail/templatetags/thumbnail.py", line 45, in render
          return self._render(context)
        File "/home/mosta/VirtualEnv/luana/local/lib/python2.7/site-packages/sorl/thumbnail/templatetags/thumbnail.py", line 97, in _render
          file_, geometry, **options
        File "/home/mosta/VirtualEnv/luana/local/lib/python2.7/site-packages/sorl/thumbnail/base.py", line 61, in get_thumbnail
          thumbnail)
        File "/home/mosta/VirtualEnv/luana/local/lib/python2.7/site-packages/sorl/thumbnail/base.py", line 86, in _create_thumbnail
          image = default.engine.create(source_image, geometry, options)
        File "/home/mosta/VirtualEnv/luana/local/lib/python2.7/site-packages/sorl/thumbnail/engines/base.py", line 17, in create
          image = self.scale(image, geometry, options)
        File "/home/mosta/VirtualEnv/luana/local/lib/python2.7/site-packages/sorl/thumbnail/engines/base.py", line 49, in scale
          image = self._scale(image, width, height)
        File "/home/mosta/VirtualEnv/luana/local/lib/python2.7/site-packages/sorl/thumbnail/engines/pil_engine.py", line 62, in _scale
          return image.resize((width, height), resample=Image.ANTIALIAS)
        File "/home/mosta/VirtualEnv/luana/local/lib/python2.7/site-packages/PIL/Image.py", line 1290, in resize
          self.load()
        File "/home/mosta/VirtualEnv/luana/local/lib/python2.7/site-packages/PIL/ImageFile.py", line 189, in load
          d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
        File "/home/mosta/VirtualEnv/luana/local/lib/python2.7/site-packages/PIL/Image.py", line 385, in _getdecoder
          raise IOError("decoder %s not available" % decoder_name)
      IOError: decoder zip not available
      

      您可能必须在安装 PIL 之前安装一些库。

      在我的情况下,问题已通过以下方式解决:

      > cd $my_virtual_env/lib
      > ln -s /usr/lib/i386-linux-gnu/libjpeg.so
      > ln -s /usr/lib/i386-linux-gnu/libfreetype.so
      > ln -s /usr/lib/i386-linux-gnu/libz.so
      > sudo pip uninstall PIL
      > sudo pip install pillow
      

      我为找到解决方案而阅读的页面:

      希望对你有帮助

      【讨论】:

        猜你喜欢
        • 2018-05-16
        • 2010-10-31
        • 2019-10-11
        • 1970-01-01
        • 1970-01-01
        • 2010-12-28
        • 2011-03-03
        • 2019-04-28
        • 2011-06-22
        相关资源
        最近更新 更多