diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 87340b88a..971efa396 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -109,28 +109,28 @@ AZURE_CONTAINER = env("DJANGO_AZURE_CONTAINER_NAME") {% if cookiecutter.use_whitenoise == 'y' -%} STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" {% elif cookiecutter.cloud_provider == 'AWS' -%} -STATICFILES_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.StaticRootS3Boto3Storage" +STATICFILES_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.StaticS3Storage" COLLECTFAST_STRATEGY = "collectfast.strategies.boto3.Boto3Strategy" STATIC_URL = f"https://{aws_s3_domain}/static/" {% elif cookiecutter.cloud_provider == 'GCP' -%} -STATICFILES_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.StaticRootGoogleCloudStorage" +STATICFILES_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.StaticGoogleCloudStorage" COLLECTFAST_STRATEGY = "collectfast.strategies.gcloud.GoogleCloudStrategy" STATIC_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/static/" {% elif cookiecutter.cloud_provider == 'Azure' -%} -STATICFILES_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.StaticRootAzureStorage" +STATICFILES_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.StaticAzureStorage" STATIC_URL = f"https://{AZURE_ACCOUNT_NAME}.blob.core.windows.net/static/" {% endif -%} # MEDIA # ------------------------------------------------------------------------------ {%- if cookiecutter.cloud_provider == 'AWS' %} -DEFAULT_FILE_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.MediaRootS3Boto3Storage" +DEFAULT_FILE_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.MediaS3Storage" MEDIA_URL = f"https://{aws_s3_domain}/media/" {%- elif cookiecutter.cloud_provider == 'GCP' %} -DEFAULT_FILE_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.MediaRootGoogleCloudStorage" +DEFAULT_FILE_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.MediaGoogleCloudStorage" MEDIA_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/media/" {%- elif cookiecutter.cloud_provider == 'Azure' %} -DEFAULT_FILE_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.MediaRootAzureStorage" +DEFAULT_FILE_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.MediaAzureStorage" MEDIA_URL = f"https://{AZURE_ACCOUNT_NAME}.blob.core.windows.net/media/" {%- endif %} diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index f04c04ffb..5c53bf111 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -17,11 +17,11 @@ hiredis==2.2.3 # https://github.com/redis/hiredis-py # Django # ------------------------------------------------------------------------------ {%- if cookiecutter.cloud_provider == 'AWS' %} -django-storages[boto3]==1.13.2 # https://github.com/jschneier/django-storages +django-storages[s3]==1.14 # https://github.com/jschneier/django-storages {%- elif cookiecutter.cloud_provider == 'GCP' %} -django-storages[google]==1.13.2 # https://github.com/jschneier/django-storages +django-storages[google]==1.14 # https://github.com/jschneier/django-storages {%- elif cookiecutter.cloud_provider == 'Azure' %} -django-storages[azure]==1.13.2 # https://github.com/jschneier/django-storages +django-storages[azure]==1.14 # https://github.com/jschneier/django-storages {%- endif %} {%- if cookiecutter.mail_service == 'Mailgun' %} django-anymail[mailgun]==10.1 # https://github.com/anymail/django-anymail diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/storages.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/storages.py index 27595ad1a..cc055378a 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/storages.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/storages.py @@ -1,36 +1,36 @@ {% if cookiecutter.cloud_provider == 'AWS' -%} -from storages.backends.s3boto3 import S3Boto3Storage +from storages.backends.s3 import S3Storage -class StaticRootS3Boto3Storage(S3Boto3Storage): +class StaticS3Storage(S3Storage): location = "static" default_acl = "public-read" -class MediaRootS3Boto3Storage(S3Boto3Storage): +class MediaS3Storage(S3Storage): location = "media" file_overwrite = False {%- elif cookiecutter.cloud_provider == 'GCP' -%} from storages.backends.gcloud import GoogleCloudStorage -class StaticRootGoogleCloudStorage(GoogleCloudStorage): +class StaticGoogleCloudStorage(GoogleCloudStorage): location = "static" default_acl = "publicRead" -class MediaRootGoogleCloudStorage(GoogleCloudStorage): +class MediaGoogleCloudStorage(GoogleCloudStorage): location = "media" file_overwrite = False {%- elif cookiecutter.cloud_provider == 'Azure' -%} from storages.backends.azure_storage import AzureStorage -class StaticRootAzureStorage(AzureStorage): +class StaticAzureStorage(AzureStorage): location = "static" -class MediaRootAzureStorage(AzureStorage): +class MediaAzureStorage(AzureStorage): location = "media" file_overwrite = False {%- endif %}