From 3bede0d9a0c588d75c7d5022ec048e53dd561462 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 4 Sep 2026 08:26:38 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(backend)=20allow=20to=20configure?= =?UTF-8?q?=20settings=20DATA=5FUPLOAD=5FMAX=5FMEMORY=5FSIZE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Release 3.17.2 of DRF now takes care of DATA_UPLOAD_MAX_MEMORY_SIZE and is checked when the body request is parsed. Before that, DRF wasn't using it at all and we were only looking for custom settings linked to the media and conversion file upload. We must now also configure this setting. --- CHANGELOG.md | 1 + documentation/env.md | 1 + src/backend/impress/settings.py | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90bcb6b24..6992ace6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to ### Fixed - 🐛(frontend) hide Leave in the doc menu when not logged in #2626 +- 🐛(backend) allow to configure settings DATA_UPLOAD_MAX_MEMORY_SIZE ## [v5.6.0] - 2026-09-03 diff --git a/documentation/env.md b/documentation/env.md index 15e18475a..70218f300 100644 --- a/documentation/env.md +++ b/documentation/env.md @@ -61,6 +61,7 @@ These are the environment variables you can set for the `impress-backend` contai | DJANGO_CORS_ALLOWED_ORIGIN_REGEXES | List of origins allowed for CORS using regulair expressions | [] | | DJANGO_CORS_ALLOW_ALL_ORIGINS | Allow all CORS origins | false | | DJANGO_CSRF_TRUSTED_ORIGINS | CSRF trusted origins | [] | +| DJANGO_DATA_UPLOAD_MAX_MEMORY_SIZE | The maximum size in bytes that a request body may be should be equal to the maximum between `DOCUMENT_IMAGE_MAX_SIZE` and `CONVERSION_FILE_MAX_SIZE`. See: https://docs.djangoproject.com/en/6.1/ref/settings/#data-upload-max-memory-size | 20 MB | | DJANGO_EMAIL_BACKEND | Email backend library | django.core.mail.backends.smtp.EmailBackend | | DJANGO_EMAIL_BRAND_NAME | Brand name for email | | | DJANGO_EMAIL_FROM | Email address used as sender | from@example.com | diff --git a/src/backend/impress/settings.py b/src/backend/impress/settings.py index 00cdb2bf4..3b4dbf9dd 100755 --- a/src/backend/impress/settings.py +++ b/src/backend/impress/settings.py @@ -206,6 +206,8 @@ class Base(Configuration): environ_prefix=None, ) + DATA_UPLOAD_MAX_MEMORY_SIZE = values.IntegerValue(20 * MB) # 20 MB + REACTIONS_MAX_PER_COMMENT = values.IntegerValue( 15, environ_name="REACTIONS_MAX_PER_COMMENT", @@ -937,7 +939,7 @@ class Base(Configuration): False, environ_name="CONVERSION_UPLOAD_ENABLED", environ_prefix=None ) CONVERSION_FILE_MAX_SIZE = values.IntegerValue( - 20 * MB, + default=DATA_UPLOAD_MAX_MEMORY_SIZE, environ_name="CONVERSION_FILE_MAX_SIZE", environ_prefix=None, )