Why can't I upload jpg files to my Django app via admin/?

后端 未结 9 1936
借酒劲吻你
借酒劲吻你 2020-12-16 14:16

I\'m trying to add images to my models in my Django app.

models.py

class ImageMain(models.Model):
  product = models.ForeignKey(Product)
  photo = mo         


        
9条回答
  •  轮回少年
    2020-12-16 14:40

    'python -v' then 'import _imaging' is useful for figuring out where _imaging.so is loaded from. If you reinstall PIL without cleaning out the PIL dir in site-packages you may still be running with an old _imaging.so under the Python package dir. PIL's selftest.py will pass, because you've got a new _imaging.so in your build dir. And make sure you edit JPEG_ROOT in setup.py to pick up the correct header and .so directories at build time.

提交回复
热议问题