Migrate to new staticfiles storage setting (#570)

This commit is contained in:
Karthik Balakrishnan 2023-05-08 10:38:33 +05:30 committed by GitHub
parent f256217d1b
commit dcc4a5723e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View file

@ -303,7 +303,11 @@ STATICFILES_FINDERS = [
STATICFILES_DIRS = [BASE_DIR / "static"] 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" SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies"

View file

@ -58,9 +58,13 @@ kwIDAQAB
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def _test_settings(settings): def _test_settings(settings):
settings.STATICFILES_STORAGE = ( # We use `StaticFilesStorage` instead of `ManifestStaticFilesStorage` in tests
"django.contrib.staticfiles.storage.StaticFilesStorage" # 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.SETUP.MAIN_DOMAIN = "example.com"
settings.MAIN_DOMAIN = "example.com" settings.MAIN_DOMAIN = "example.com"