我确实在django doc上找到了这篇文档:
引发SuspiciousOperation(RequestDataTooBig)之前请求正文的最大大小(以字节为单位)。在访问request.body或request.POST时完成检查,并根据不包括任何文件上载数据的总请求大小计算。 您可以将此项设置为“无”以禁用检查 。预计会收到异常大型表单帖子的应用程序应调整此设置。
但我不知道如何禁用该检查,我得到的错误是:
Request body exceeded settings.DATA_UPLOAD_MAX_MEMORY_SIZE.
Request body exceeded settings.DATA_UPLOAD_MAX_MEMORY_SIZE.
Request body exceeded settings.DATA_UPLOAD_MAX_MEMORY_SIZE.
Request body exceeded settings.DATA_UPLOAD_MAX_MEMORY_SIZE.
Request body exceeded settings.DATA_UPLOAD_MAX_MEMORY_SIZE.
Request body exceeded settings.DATA_UPLOAD_MAX_MEMORY_SIZE.
Request body exceeded settings.DATA_UPLOAD_MAX_MEMORY_SIZE.
Request body exceeded settings.DATA_UPLOAD_MAX_MEMORY_SIZE.
答案 0 :(得分:2)
您可以在DATA_UPLOAD_MAX_MEMORY_SIZE = None
内设置settings.py
。但设置None
可能会导致安全漏洞!