小编Pra*_*kla的帖子

提交的数据不是文件.检查DRF 3中表单上的编码类型

OutputError

{
 "item_image": [
    "The submitted data was not a file. Check the encoding type on the form."
],
"item_thumb": [
    "The submitted data was not a file. Check the encoding type on the form."
]
}
Run Code Online (Sandbox Code Playgroud)

我发布的数据是

输入

{
    "item_name": "Lural",
    "item_image": "/home/prashant/Desktop/suede.png",
    "item_thumb": "/home/prashant/Desktop/suede.png",
    "item_description": "sd",
    "item_mass": 1,
    "item_category": "Make Up",
    "item_sub_category": "Sub-Feminine",
    "item_est_price": "123.12",
    "item_wst_price": "120.34"
}
Run Code Online (Sandbox Code Playgroud)

适用于媒体类型应用/ json

views.py

@api_view(['GET', 'POST'])
def product_list(request):
    if request.method == 'POST':
        serializer = ProductSerializer( data=request.data)
        # data.encode("base64")
        if serializer.is_valid():
            serializer.save() …
Run Code Online (Sandbox Code Playgroud)

python django django-models django-rest-framework

7
推荐指数
1
解决办法
4818
查看次数

DRF 中的推送通知

在 django rest 框架中实现推送通知的确切和最合适的方法应该是什么。DRF 文档没有很好地解释它。帮我解决这个问题

python django push-notification django-rest-framework

7
推荐指数
1
解决办法
8987
查看次数

Fortran中的零索引数组?

有人可以解释什么是Fortran 中的零索引数组以及示例。我没有在互联网上获得任何内容。

fortran fortran90

0
推荐指数
1
解决办法
6023
查看次数