Skip to content

Commit 2522056

Browse files
committed
Closes #12872: Introduce DATA_UPLOAD_MAX_MEMORY_SIZE config parameter
1 parent 01c894e commit 2522056

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

docs/configuration/miscellaneous.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ changes in the database indefinitely.
8080

8181
---
8282

83+
## DATA_UPLOAD_MAX_MEMORY_SIZE
84+
85+
Default: `2621440` (2.5 MB)
86+
87+
The maximum size (in bytes) of an incoming HTTP request (i.e. `GET` or `POST` data). Requests which exceed this size will raise a `RequestDataTooBig` exception.
88+
89+
---
90+
8391
## ENFORCE_GLOBAL_UNIQUE
8492

8593
!!! tip "Dynamic Configuration Parameter"
@@ -90,9 +98,9 @@ By default, NetBox will permit users to create duplicate prefixes and IP address
9098

9199
---
92100

93-
## `FILE_UPLOAD_MAX_MEMORY_SIZE`
101+
## FILE_UPLOAD_MAX_MEMORY_SIZE
94102

95-
Default: `2621440` (2.5 MB).
103+
Default: `2621440` (2.5 MB)
96104

97105
The maximum amount (in bytes) of uploaded data that will be held in memory before being written to the filesystem. Changing this setting can be useful for example to be able to upload files bigger than 2.5MB to custom scripts for processing.
98106

netbox/netbox/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
CSRF_COOKIE_NAME = getattr(configuration, 'CSRF_COOKIE_NAME', 'csrftoken')
9696
CSRF_COOKIE_SECURE = getattr(configuration, 'CSRF_COOKIE_SECURE', False)
9797
CSRF_TRUSTED_ORIGINS = getattr(configuration, 'CSRF_TRUSTED_ORIGINS', [])
98+
DATA_UPLOAD_MAX_MEMORY_SIZE = getattr(configuration, 'DATA_UPLOAD_MAX_MEMORY_SIZE', 2621440)
9899
DATE_FORMAT = getattr(configuration, 'DATE_FORMAT', 'N j, Y')
99100
DATETIME_FORMAT = getattr(configuration, 'DATETIME_FORMAT', 'N j, Y g:i a')
100101
DEBUG = getattr(configuration, 'DEBUG', False)

0 commit comments

Comments
 (0)