我有一个Django应用程序处理文件。 上传过程适用于小文件(70 Mo)。但是,当我尝试上传大文件(~3Go)时会出现错误:
Environment:
Request Method: POST
Request URL: http://localhost:8000/import/
Django Version: 1.5.1
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_jenkins',
'libs',
'bootstrapform',
'origami',
'debug_toolbar')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware')
Traceback:
File "/home/antoine/workspace/server/.virtualenv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
187. response = middleware_method(request, response)
File "/home/antoine/workspace/server/.virtualenv/local/lib/python2.7/site-packages/django/contrib/sessions/middleware.py" in process_response
38. request.session.save()
File "/home/antoine/workspace/server/.virtualenv/local/lib/python2.7/site-packages/django/contrib/sessions/backends/db.py" in save
51. session_data=self.encode(self._get_session(no_load=must_create)),
File "/home/antoine/workspace/server/.virtualenv/local/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py" in encode
86. pickled = pickle.dumps(session_dict, pickle.HIGHEST_PROTOCOL)
Exception Type: SystemError at /import/
Exception Value: error return without exception set
上传大小限制设置如下:
FILE_UPLOAD_MAX_MEMORY_SIZE = 5368709120
你能告诉我这是django限制,还是我身边的麻烦? 在第一种情况下,上传大文件的方法是什么?
编辑:我的机器在开始上传时有14个免费RAM。