我正在使用django imagekit创建我的图像字段的缩略图。在
class CustomUser(AbstractBaseUser, PermissionsMixin):
email = models.EmailField(_('email address'), max_length=254, unique=True)
image = ProcessedImageField(upload_to= generate_random_filename,
processors=[ResizeToFill(640, 640)],
format='JPEG',
options={'quality': 60})
avatar = ImageSpecField(source='image',
processors=[ResizeToFill(96, 96)],
format='JPEG',
options={'quality': 60})
现在,我使用django rest framework为上述模型创建了一个序列化程序:
^{pr2}$我创造了一个泛型.createAPI视图要保存新用户,但会出现错误:
UnicodeDecodeError at /register/
'ascii' codec can't decode byte 0xff in position 11: ordinal not in range(128)
Unicode error hint
The string that could not be encoded/decoded was: "����\u
我不明白。请帮忙。如果我从序列化程序中删除avatar就可以了。在
目前没有回答
相关问题 更多 >
编程相关推荐