ImageKit在过去几天给了我很头痛的问题。我的网站上有一个内部服务器错误,因为我跟着例子ImageSpecField的GitHub页:Django-ImageKit问题与ImageSpecField原始图像
avatar_thumbnail = ImageSpecField(source='avatar',
processors=[ResizeToFill(100, 50)],
format='JPEG',
options={'quality': 60})
得到的错误是:
TypeError: __init__() got an unexpected keyword argument 'source'
所以,我更新为使用的例子ImageSpecField的avatar_thumbnail在ReadTheDocs页:
avatar_thumbnail = ImageSpecField(image_field='avatar',
processors=[ResizeToFill(100, 50)],
format='JPEG',
options={'quality': 60})
然后我得到了错误:
TypeError: __init__() got an unexpected keyword argument 'image_field'
奇怪的是,当我使用'源'应用程序将成功地运行本地没有错误。在服务器上,应用程序与'image_field'一起运行,没有内部错误,但实际上并没有创建或显示头像图像。服务器和本地都安装了django-imagekit的2.0.4版本。
任何建议将是美好的。
我正在将我的imagekit从2.0.4升级到3.2.5(现在是最新版本)。我发现从“image_field”到“source”的变化,但可能还有其他变化,我不知道。我无法从您的网站找到任何更新日志。你能指点我一些正确的资源吗?谢谢! –