Why can't I upload jpg files to my Django app via admin/?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to add images to my models in my Django app. models.py class ImageMain ( models . Model ): product = models . ForeignKey ( Product ) photo = models . ImageField ( upload_to = 'products' ) In development mode, every time I try to upload the image via Django admin, I keep getting: Upload a valid image. The file you uploaded was either not an image or a corrupted image. I installed libjpeg via fink and then installed PIL 1.1.6 on ox X 10.5.7 from PIL import Image file = open ( '/Users/Bryan/work/review_app/media/lcdtvs