From 5f0414138b4ef113f39cda80611dc8a2e41a6f15 Mon Sep 17 00:00:00 2001 From: Marie Date: Mon, 2 Jun 2025 15:45:52 +0200 Subject: [PATCH] chore(api): update to latest storage spec --- api/config/settings/common.py | 12 ++++++++++-- api/config/settings/production.py | 4 ---- changes/changelog.d/2459-storagespec | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 changes/changelog.d/2459-storagespec diff --git a/api/config/settings/common.py b/api/config/settings/common.py index c0747ad33..f2323e363 100644 --- a/api/config/settings/common.py +++ b/api/config/settings/common.py @@ -556,7 +556,15 @@ The path where static files are collected. """ # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url STATIC_URL = env("STATIC_URL", default=FUNKWHALE_URL + "/staticfiles/") -DEFAULT_FILE_STORAGE = "funkwhale_api.common.storage.ASCIIFileSystemStorage" +STORAGES = { + "default": { + "BACKEND": "funkwhale_api.common.storage.ASCIIFileSystemStorage", + }, + "staticfiles": { + "BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage", + }, +} + PROXY_MEDIA = env.bool("PROXY_MEDIA", default=True) """ @@ -655,7 +663,7 @@ if AWS_ACCESS_KEY_ID: A directory in your S3 bucket where you store files. Use this if you plan to share the bucket between services. """ - DEFAULT_FILE_STORAGE = "funkwhale_api.common.storage.ASCIIS3Boto3Storage" + STORAGES["default"]["BACKEND"] = "funkwhale_api.common.storage.ASCIIS3Boto3Storage" # See: diff --git a/api/config/settings/production.py b/api/config/settings/production.py index 815828bd5..7f8639a4d 100644 --- a/api/config/settings/production.py +++ b/api/config/settings/production.py @@ -41,10 +41,6 @@ SECRET_KEY = env("DJANGO_SECRET_KEY") # SESSION_COOKIE_HTTPONLY = True # SECURE_SSL_REDIRECT = env.bool("DJANGO_SECURE_SSL_REDIRECT", default=True) -# Static Assets -# ------------------------ -STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage" - # TEMPLATE CONFIGURATION # ------------------------------------------------------------------------------ # See: diff --git a/changes/changelog.d/2459-storagespec b/changes/changelog.d/2459-storagespec new file mode 100644 index 000000000..144f60497 --- /dev/null +++ b/changes/changelog.d/2459-storagespec @@ -0,0 +1 @@ +Updated the django-storage specification to the latest version (#2459)