Skip to content

Commit

Permalink
Migrate to new staticfiles storage setting (jointakahe#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikb351 authored May 8, 2023
1 parent f256217 commit dcc4a57
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion takahe/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,11 @@ class Config:

STATICFILES_DIRS = [BASE_DIR / "static"]

STATICFILES_STORAGE = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"
STORAGES = {
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"
},
}

SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies"

Expand Down
10 changes: 7 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ def keypair():

@pytest.fixture(autouse=True)
def _test_settings(settings):
settings.STATICFILES_STORAGE = (
"django.contrib.staticfiles.storage.StaticFilesStorage"
)
# We use `StaticFilesStorage` instead of `ManifestStaticFilesStorage` in tests
# since want stable filenames (`css/styles.css`) instead of hashed (`css/styles.55e7cbb9ba48.css`)
settings.STORAGES = {
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"
},
}
settings.SETUP.MAIN_DOMAIN = "example.com"
settings.MAIN_DOMAIN = "example.com"

Expand Down

0 comments on commit dcc4a57

Please sign in to comment.