Opened 4 years ago
Closed 4 years ago
#32033 closed Bug (invalid)
No longer able to override DATA_UPLOAD_MAX_MEMORY_SIZE outside of settings.py
Reported by: | Drew Scholz | Owned by: | nobody |
---|---|---|---|
Component: | File uploads/storage | Version: | 2.0 |
Severity: | Normal | Keywords: | DATA_UPLOAD_MAX_MEMORY_SIZE, override, settings |
Cc: | drew.scholz@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
After upgrading our Django 1.11 project from Python 2.7 to 3.7, our single endpoint decorator to override django conf settings no longer works. requests.py inside the virtual environment /lib/python3.7/site-packages/django/http triggers the RequestDataTooBig exception (~line 271) before the change to DATA_UPLOAD_MAX_MEMORY_SIZE has been increased by our decorator. We are able to make the change global inside settings.py however we are concerned with the security vulnerabilities due to the size we want to allow for the single endpoint.
Attachments (1)
Change History (2)
by , 4 years ago
Attachment: | decorators.py added |
---|
comment:1 by , 4 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
HI Drew.
1.11 is end of life now, but if the change occurred upgrading Python then I'm not clear how this is really a Django issue?
Modifying settings at runtime is not supported. Nonetheless, looking at the latest versions, I'd guess your decorator would work as long as it were applied before accessing the request body (in a middleware say). I'd look there if it's not.
Either way, this isn't an appropriate question for the issue tracker. Please see TicketClosingReasons/UseSupportChannels.
Good luck.