我有以下设置:
#models.py
class Image(models.Model):
original = models.ImageField(upload_to='images/')
formatted_image = ImageSpecField(source='original', format='JPEG', options={'quality': 90})
#serializers.py
class ImageSerializer(serializers.ModelSerializer):
class Meta:
model = Image
#views.py
class ImageViewSet(viewsets.ModelViewSet):
model = Image
serializer_class = ImageSerializer
根据 ImageKit 文档,这应该可以解决问题,但实际上什么也没发生。甚至没有错误或任何东西。我究竟做错了什么?