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