我收到一个错误:"GET/POST参数的数量超过了设置.数据\u上传\u最大\u数量\u字段".
错误显示ToomanyFieldSent在/api/upload
.
我在我views.py
岁的时候写的.
def upload(request):
id, array = common(request)
if request.FILES:
file = request.FILES['req'].temporary_file_path()
else:
return HttpResponse('<h1>NG</h1>')
return HttpResponse('<h1>OK</h1>')
def common(request):
id = json_body.get("access", "0")
if id == "":
id = "0"
s = []
with open(ID_TXT, 'r') as f:
for line in f:
s += list(map(int, line.rstrip().split(',')[:-1]))
array = [s[i:i + 2] for i in range(0, len(s), 2)]
return id, array
我使用postman 投递Access&;Request数据,如下所示: 个
我认为这个错误是由于无法发送文件大小的限制,所以我在设置中添加了代码.py
DATA_UPLOAD_MAX_MEMORY_SIZE = 100000000
但是错误并没有解决.我读到这个页面:How to avoid "The number of GET/POST parameters exceeded" error?作为参考.我该怎么解决这个问题呢?