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

后端 未结 9 1929
借酒劲吻你
借酒劲吻你 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:31

    Did you install libjpeg after PIL was already compiled/installed on the system? Maybe it can't find the decoder properly?

    Here's one set of instructions I found on getting libjpeg and PIL playing nicely on MacOS (see towards the end; looks like you may need to explicitly set the dir of the decoder):

    http://djangodays.com/2008/09/03/django-imagefield-validation-error-caused-by-incorrect-pil-installation-on-mac/

提交回复
热议问题