From 2a29cd0e707e7b3f8d808fa0d53602b2e37ddf29 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 3 Jan 2024 16:51:43 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BD=BF=E7=94=A8=20nginx=20=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=9D=99=E6=80=81=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jumpserver/settings/base.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/jumpserver/settings/base.py b/apps/jumpserver/settings/base.py index e2bfbc5c1..aebb73741 100644 --- a/apps/jumpserver/settings/base.py +++ b/apps/jumpserver/settings/base.py @@ -312,12 +312,17 @@ STATICFILES_DIRS = ( os.path.join(BASE_DIR, "static"), ) -# Media files (File, ImageField) will be save these +# Media files (File, ImageField) will be safe these MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(PROJECT_DIR, 'data', 'media').replace('\\', '/') + '/' PRIVATE_STORAGE_ROOT = MEDIA_ROOT PRIVATE_STORAGE_AUTH_FUNCTION = 'jumpserver.rewriting.storage.permissions.allow_access' +PRIVATE_STORAGE_INTERNAL_URL = '/private-media/' +PRIVATE_STORAGE_SERVER = 'nginx' +if DEBUG_DEV: + PRIVATE_STORAGE_SERVER = 'django' + # Use django-bootstrap-form to format template, input max width arg # BOOTSTRAP_COLUMN_COUNT = 11