TypeError:无法序列化'_io.BufferedRandom';对象,同时尝试在Django中上载文件

TypeError:无法序列化'_io.BufferedRandom';对象,同时尝试在Django中上载文件,django,Django,我试图在Django中上载一些文件,但有时当文件大小增加时,会出现以下错误: TypeError:无法序列化'\u io.BufferedRandom'对象 在目前的情况下,我试图上传一个文件(大小~3Mb),但它仍然显示错误。 我尝试在网络中检查文件是否已上载,但它显示: 我无法理解要解决此问题需要做哪些更改,请尝试将settings.py中的FILE\u UPLOAD\u MAX\u MEMORY\u SIZE=5242880设置为更高的值(5MB),以使文件(谢谢!我也遇到了同样的问题)

我试图在Django中上载一些文件,但有时当文件大小增加时,会出现以下错误:

TypeError:无法序列化'\u io.BufferedRandom'对象

在目前的情况下,我试图上传一个文件(大小~3Mb),但它仍然显示错误。 我尝试在网络中检查文件是否已上载,但它显示:


我无法理解要解决此问题需要做哪些更改,请尝试将
settings.py
中的
FILE\u UPLOAD\u MAX\u MEMORY\u SIZE=5242880
设置为更高的值(5MB),以使文件(谢谢!我也遇到了同样的问题)。
def handle_raw_input(self, input_data, META, content_length, boundary, encoding=None):
    """
    Use the content_length to signal whether or not this handler should be
    used.
    """
    # Check the content-length header to see if we should
    # If the post is too large, we cannot use the Memory handler.
    self.activated = content_length <= settings.FILE_UPLOAD_MAX_MEMORY_SIZE