Rename our subclasses for S3Storage to match parent naming

This commit is contained in:
Bruno Alla 2023-09-11 16:28:47 +01:00
parent e0d7eee13a
commit 0dd11261c1
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View File

@ -109,7 +109,7 @@ AZURE_CONTAINER = env("DJANGO_AZURE_CONTAINER_NAME")
{% if cookiecutter.use_whitenoise == 'y' -%} {% if cookiecutter.use_whitenoise == 'y' -%}
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
{% elif cookiecutter.cloud_provider == 'AWS' -%} {% elif cookiecutter.cloud_provider == 'AWS' -%}
STATICFILES_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.StaticRootS3Boto3Storage" STATICFILES_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.StaticRootS3Storage"
COLLECTFAST_STRATEGY = "collectfast.strategies.boto3.Boto3Strategy" COLLECTFAST_STRATEGY = "collectfast.strategies.boto3.Boto3Strategy"
STATIC_URL = f"https://{aws_s3_domain}/static/" STATIC_URL = f"https://{aws_s3_domain}/static/"
{% elif cookiecutter.cloud_provider == 'GCP' -%} {% elif cookiecutter.cloud_provider == 'GCP' -%}
@ -124,7 +124,7 @@ STATIC_URL = f"https://{AZURE_ACCOUNT_NAME}.blob.core.windows.net/static/"
# MEDIA # MEDIA
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
{%- if cookiecutter.cloud_provider == 'AWS' %} {%- if cookiecutter.cloud_provider == 'AWS' %}
DEFAULT_FILE_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.MediaRootS3Boto3Storage" DEFAULT_FILE_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.MediaRootS3Storage"
MEDIA_URL = f"https://{aws_s3_domain}/media/" MEDIA_URL = f"https://{aws_s3_domain}/media/"
{%- elif cookiecutter.cloud_provider == 'GCP' %} {%- elif cookiecutter.cloud_provider == 'GCP' %}
DEFAULT_FILE_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.MediaRootGoogleCloudStorage" DEFAULT_FILE_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.MediaRootGoogleCloudStorage"

View File

@ -2,12 +2,12 @@
from storages.backends.s3 import S3Storage from storages.backends.s3 import S3Storage
class StaticRootS3Boto3Storage(S3Storage): class StaticRootS3Storage(S3Storage):
location = "static" location = "static"
default_acl = "public-read" default_acl = "public-read"
class MediaRootS3Boto3Storage(S3Storage): class MediaRootS3Storage(S3Storage):
location = "media" location = "media"
file_overwrite = False file_overwrite = False
{%- elif cookiecutter.cloud_provider == 'GCP' -%} {%- elif cookiecutter.cloud_provider == 'GCP' -%}