python
data_error
ai_generated
true
django.core.exceptions.RequestDataTooBig: Request body exceeded settings.FILE_UPLOAD_MAX_MEMORY_SIZE.
ID: python/django-request-body-too-large
80%Fix Rate
86%Confidence
0Evidence
2026-04-19First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
Uploaded file exceeds the in-memory upload limit.
generic中文
上传文件超过内存中的上传限制。
Workarounds
-
90% success
Set FILE_UPLOAD_MAX_MEMORY_SIZE = 10485760 (10MB) in settings.py.
-
85% success
Use FILE_UPLOAD_HANDLERS to stream large files to disk: ['django.core.files.uploadhandler.TemporaryFileUploadHandler']
Dead Ends
Common approaches that don't work:
-
60% fail
Increasing only DATA_UPLOAD_MAX_MEMORY_SIZE doesn't affect file upload limit.
-
40% fail
Setting FILE_UPLOAD_MAX_MEMORY_SIZE=0 disables limit but can cause memory issues.