Mac下使用django的ImageField是出错?

使用django的models:

class User(models.Model):
    headpic = models.ImageField(upload_to="local_path")
    ....


执行validate时,报一下错误:

 "headpic": To use ImageFields, you need to install the Python Imaging Library. Get it at http://www.pythonware.com/products/pil/ .

缺少PIL.

解决办法:

downloading PIL package and the run sudo python setup.py install.

安装后,一切OK!

你可能感兴趣的:(django,python)