From 1ee778d76483057f36ff218e1d1170e2070f2b10 Mon Sep 17 00:00:00 2001 From: Fasand Date: Mon, 24 Jul 2023 13:00:00 +0200 Subject: [PATCH] #636: add Django FILE_UPLOAD_MAX_MEMORY_SIZE and Nginx client_max_body_size settings as ~ 50MB --- Seeder/settings/env.py | 3 +++ ci/nginx.conf | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Seeder/settings/env.py b/Seeder/settings/env.py index 51a2a6ff..b5c6d81e 100755 --- a/Seeder/settings/env.py +++ b/Seeder/settings/env.py @@ -34,6 +34,9 @@ INTERNAL_IPS = os.environ.get('INTERNAL_IPS', '127.0.0.1').split(' ') +FILE_UPLOAD_MAX_MEMORY_SIZE = int(os.environ.get( + 'FILE_UPLOAD_MAX_MEMORY_SIZE', 52428800)) # 50*1024*1024 = 50 MiB + # Database # https://docs.djangoproject.com/en/1.7/ref/settings/#databases # since we use special PostgresSQL fields we cannot simply use any db. diff --git a/ci/nginx.conf b/ci/nginx.conf index 953719b9..91c62005 100644 --- a/ci/nginx.conf +++ b/ci/nginx.conf @@ -5,5 +5,9 @@ server { location /media/ { root /seeder; } - listen 0.0.0.0:80; + + # Increase max upload size to ~50MB + client_max_body_size 53M; + + listen 0.0.0.0:80; }