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 e565682
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
build: .
command: overmind start && rm -rf .overmind.sock
environment:
- OVERMIND_PROCFILE=Procfile.dev
# - OVERMIND_PROCFILE=Procfile.dev
- GLOBAL_LINK_PORT=9000
- WEBSITE_LINK_PORT=9000
- PROJECT_DOMAIN=dev.spacelog.org
Expand Down
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 e565682

Please sign in to comment.