Skip to content

Commit

Permalink
Update pre-commit-config setting for django-upgrade, changes STORAGES…
Browse files Browse the repository at this point in the history
… setting
  • Loading branch information
vdboor committed Aug 26, 2024
1 parent 0b18504 commit efe8fcb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
hooks:
- id: django-upgrade
args:
- --target-version=3.2
- --target-version=4.2
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.5
hooks:
Expand Down
9 changes: 8 additions & 1 deletion src/dso_api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,14 @@
VIEW_NAME_FUNCTION="rest_framework_dso.views.get_view_name",
)

STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
STORAGES = {
"default": {
"BACKEND": "django.core.files.storage.FileSystemStorage",
},
"staticfiles": {
"BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage",
},
}

SPECTACULAR_SETTINGS = {
"TITLE": "DSO-API",
Expand Down
7 changes: 6 additions & 1 deletion src/tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@

# Prevent tests to crash because of missing staticfiles manifests
WHITENOISE_MANIFEST_STRICT = False
STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage"
STORAGES = {
**STORAGES,
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
},
}

# During testing we want to see if there is unwanted deferred access
SEAL_WARN_ONLY = False

0 comments on commit efe8fcb

Please sign in to comment.