Skip to content

Commit d0a1e00

Browse files
committed
Switch to WhiteNoise for production
1 parent d16bfdb commit d0a1e00

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

config/settings/production.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
aws_s3_domain = AWS_S3_CUSTOM_DOMAIN or f"{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com"
8888
# STATIC
8989
# ------------------------
90-
STATICFILES_STORAGE = "course_api.utils.storages.StaticRootS3Boto3Storage"
90+
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
9191
COLLECTFAST_STRATEGY = "collectfast.strategies.boto3.Boto3Strategy"
9292
STATIC_URL = f"https://{aws_s3_domain}/static/"
9393
# MEDIA
@@ -204,3 +204,4 @@
204204

205205
# Your stuff...
206206
# ------------------------------------------------------------------------------
207+
MIDDLEWARE+=["whitenoise.middleware.WhiteNoiseMiddleware"]

requirements/production.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ sentry-sdk==1.5.4 # https://github.com/getsentry/sentry-python
1111
# ------------------------------------------------------------------------------
1212
django-storages[boto3]==1.12.3 # https://github.com/jschneier/django-storages
1313
django-anymail[sendgrid]==8.5 # https://github.com/anymail/django-anymail
14+
15+
# Whitenoise
16+
whitenoise==6.0.0

0 commit comments

Comments
 (0)