Skip to content

Commit

Permalink
fixup! Load statics the modern way
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveMarshall committed Apr 1, 2024
1 parent da4829d commit be706b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion global/configs/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@
"staticfiles": {
"BACKEND": 'whitenoise.storage.CompressedManifestStaticFilesStorage',
},
"digest_free_staticfiles": {
"BACKEND": 'whitenoise.storage.CompressedStaticFilesStorage',
},
}
STATICFILES_DIGEST_FREE_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
STATICFILES_DIRS = [
os.path.join(SITE_ROOT, 'static'),
]
Expand Down
4 changes: 2 additions & 2 deletions website/apps/transcripts/templatetags/missionstatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
)


staticfiles_digest_free_storage = storages["staticfiles"]
staticfiles_digest_free_storage = storages["digest_free_staticfiles"]

def full_path(mission, *path):
"""
Expand All @@ -19,7 +19,7 @@ def full_path(mission, *path):

def digest_free_static(path):
"""
Uses STATICFILES_DIGEST_FREE_STORAGE instead of STATICFILES_STORAGE
Uses storages["digest_free_staticfiles"] instead of storages["staticfiles"]
to produce a URL that doesn't include the digest of the file's current
contents.
Expand Down
4 changes: 3 additions & 1 deletion website/configs/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@
"staticfiles": {
"BACKEND": 'whitenoise.storage.CompressedManifestStaticFilesStorage',
},
"digest_free_staticfiles": {
"BACKEND": 'whitenoise.storage.CompressedStaticFilesStorage',
},
}
STATICFILES_DIGEST_FREE_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
STATICFILES_DIRS = [
os.path.join(SITE_ROOT, 'static'),
]
Expand Down

0 comments on commit be706b3

Please sign in to comment.