Skip to content

Commit

Permalink
use ManifestStaticFilesStorage to avoid delivering expired files
Browse files Browse the repository at this point in the history
  • Loading branch information
jrief committed Sep 23, 2023
1 parent 542348d commit db1f8e2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions testapp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@

STATIC_URL = '/static/'

STORAGES = {
'default': {
'BACKEND': 'django.core.files.storage.FileSystemStorage',
},
'staticfiles': {
'BACKEND': 'django.contrib.staticfiles.storage.StaticFilesStorage' if DEBUG else \
'django.contrib.staticfiles.storage.ManifestStaticFilesStorage',
},
}

MEDIA_ROOT = Path(os.getenv('DJANGO_MEDIA_ROOT', BASE_DIR / 'workdir/media'))

MEDIA_URL = '/media/'
Expand Down

0 comments on commit db1f8e2

Please sign in to comment.