From a01a0da25bfc61cc717e972f51e0a6f4daa578b2 Mon Sep 17 00:00:00 2001 From: prog1764 Date: Wed, 5 Aug 2026 13:13:22 +0400 Subject: [PATCH] =?UTF-8?q?fix(docker):=20whitenoise=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D0=BE=D1=82=D0=B4=D0=B0=D1=87=D0=B8=20=D1=81=D1=82=D0=B0?= =?UTF-8?q?=D1=82=D0=B8=D0=BA=D0=B8=20=D0=B2=20production=20(teacher.labne?= =?UTF-8?q?thub.ru=20=D0=BE=D1=82=D0=B4=D0=B0=D0=B2=D0=B0=D0=BB=20404=20?= =?UTF-8?q?=D0=BD=D0=B0=20/static/)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/settings.py | 8 ++++++++ requirements.txt | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/config/settings.py b/config/settings.py index c66566c..3aa0e0e 100644 --- a/config/settings.py +++ b/config/settings.py @@ -40,6 +40,7 @@ INSTALLED_APPS = [ MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", + "whitenoise.middleware.WhiteNoiseMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", @@ -109,6 +110,13 @@ USE_I18N = True USE_TZ = True STATIC_URL = "static/" + +STORAGES = { + "default": {"BACKEND": "django.core.files.storage.FileSystemStorage"}, + "staticfiles": { + "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage", + }, +} STATICFILES_DIRS = [BASE_DIR / "static"] STATIC_ROOT = BASE_DIR / "staticfiles" diff --git a/requirements.txt b/requirements.txt index 144a429..43ec458 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ Django>=5.0,<6.0 django-axes>=8.3.1 python-dotenv>=1.0 gunicorn>=22.0 - +whitenoise>=6.6