From bf6c7e8e9c4fa921312737b155d07cd30126ed75 Mon Sep 17 00:00:00 2001 From: Umair Ashraf Date: Wed, 12 Sep 2018 13:45:30 -0400 Subject: [PATCH 1/2] fixed s3 http url for static and media storage --- {{cookiecutter.project_slug}}/config/settings/production.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 509455ed..343af72b 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -87,14 +87,14 @@ AWS_S3_OBJECT_PARAMETERS = { STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' {%- else %} STATICFILES_STORAGE = 'config.settings.production.StaticRootS3Boto3Storage' -STATIC_URL = f'https://s3.amazonaws.com/{AWS_STORAGE_BUCKET_NAME}/static/' +STATIC_URL = f'https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/' {%- endif %} # MEDIA # ------------------------------------------------------------------------------ {% if cookiecutter.use_whitenoise == 'y' -%} DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' -MEDIA_URL = f'https://s3.amazonaws.com/{AWS_STORAGE_BUCKET_NAME}/' +MEDIA_URL = f'https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/' {%- else %} # region http://stackoverflow.com/questions/10390244/ # Full-fledge class: https://stackoverflow.com/a/18046120/104731 @@ -112,7 +112,7 @@ class MediaRootS3Boto3Storage(S3Boto3Storage): # endregion DEFAULT_FILE_STORAGE = 'config.settings.production.MediaRootS3Boto3Storage' -MEDIA_URL = f'https://s3.amazonaws.com/{AWS_STORAGE_BUCKET_NAME}/media/' +MEDIA_URL = f'https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/media/' {%- endif %} # TEMPLATES From 18ada469de35fed1d8b7ffe9d299032fc62848bb Mon Sep 17 00:00:00 2001 From: Umair Ashraf Date: Wed, 12 Sep 2018 13:57:11 -0400 Subject: [PATCH 2/2] added myself to contributors --- CONTRIBUTORS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 2d9d278b..c17c951e 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -162,6 +162,7 @@ Listed in alphabetical order. Tom Atkins `@knitatoms`_ Tom Offermann Travis McNeill `@Travistock`_ @tavistock_esq + Umair Ashraf `@umrashrf`_ @fabumair Vitaly Babiy Vivian Guillen `@viviangb`_ Will Farley `@goldhand`_ @g01dhand @@ -276,6 +277,7 @@ Listed in alphabetical order. .. _@pchiquet: https://github.com/pchiquet .. _@delneg: https://github.com/delneg .. _@purplediane: https://github.com/purplediane +.. _@umrashrf: https://github.com/umrashrf Special Thanks ~~~~~~~~~~~~~~