django-rest-framework 나는 API를 통해 이미지를 업로드하는 방법을 사용하여 이미지 필드가 있습니까?django-rest-framework 및 업로드 이미지
예가 있습니까?
models.py
image = models.ImageField(
upload_to="profiles",
height_field="height",
width_field="width",
null=True,
blank=True,
editable=True,
help_text="Profile Picture",
verbose_name="Profile Picture"
)
height = models.PositiveIntegerField(null=True, blank=True, editable=False)
width = models.PositiveIntegerField(null=True, blank=True, editable=False)
http://stackoverflow.com/questions/을 업로드 내 작업 코드
views.py
urls.py
컬 요청입니다 11398696/upload-image-to-imagefield-djangorestframework-using-json-and-test-this-wit – catherine