From 9a3a796a89293c5129cfa9f5bb9d69ad54e54c8b Mon Sep 17 00:00:00 2001 From: Tano Abeleyra Date: Sat, 18 May 2019 20:24:29 -0300 Subject: [PATCH] Use GCP acronym for Google Cloud Platform --- README.rst | 2 +- cookiecutter.json | 2 +- docs/project-generation-options.rst | 4 ++-- docs/settings.rst | 2 +- {{cookiecutter.project_slug}}/.envs/.production/.django | 6 +++--- .../config/settings/production.py | 8 ++++---- {{cookiecutter.project_slug}}/requirements/production.txt | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.rst b/README.rst index 7468981c..30a3a2db 100644 --- a/README.rst +++ b/README.rst @@ -181,7 +181,7 @@ Answer the prompts with your own desired options_. For example:: Choose from 1, 2 [1]: 1 Select cloud_provider: 1 - AWS - 2 - GCS + 2 - GCP 3 - None Choose from 1, 2, 3 [1]: 1 custom_bootstrap_compilation [n]: n diff --git a/cookiecutter.json b/cookiecutter.json index 15e0aac6..d6d217ca 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -30,7 +30,7 @@ ], "cloud_provider": [ "AWS", - "GCE", + "GCP", "None" ], "custom_bootstrap_compilation": "n", diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index 42368690..afa9b8af 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -65,7 +65,7 @@ cloud_provider: Select a cloud provider for static & media files. The choices are: 1. AWS_ - 2. GCS_ + 2. GCP_ 3. None Note that if you choose no cloud provider, media files won't work. @@ -123,7 +123,7 @@ debug: .. _Gulp: https://github.com/gulpjs/gulp .. _AWS: https://aws.amazon.com/s3/ -.. _GCS: https://cloud.google.com/storage/ +.. _GCP: https://cloud.google.com/storage/ .. _Django Compressor: https://github.com/django-compressor/django-compressor diff --git a/docs/settings.rst b/docs/settings.rst index 0234ac85..d0edce31 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -45,7 +45,7 @@ DJANGO_AWS_ACCESS_KEY_ID AWS_ACCESS_KEY_ID n/a DJANGO_AWS_SECRET_ACCESS_KEY AWS_SECRET_ACCESS_KEY n/a raises error DJANGO_AWS_STORAGE_BUCKET_NAME AWS_STORAGE_BUCKET_NAME n/a raises error DJANGO_AWS_S3_REGION_NAME AWS_S3_REGION_NAME n/a None -DJANGO_GCE_STORAGE_BUCKET_NAME GS_BUCKET_NAME n/a raises error +DJANGO_GCP_STORAGE_BUCKET_NAME GS_BUCKET_NAME n/a raises error GOOGLE_APPLICATION_CREDENTIALS n/a n/a raises error SENTRY_DSN SENTRY_DSN n/a raises error DJANGO_SENTRY_LOG_LEVEL SENTRY_LOG_LEVEL n/a logging.INFO diff --git a/{{cookiecutter.project_slug}}/.envs/.production/.django b/{{cookiecutter.project_slug}}/.envs/.production/.django index a938ada6..2c2e94f2 100644 --- a/{{cookiecutter.project_slug}}/.envs/.production/.django +++ b/{{cookiecutter.project_slug}}/.envs/.production/.django @@ -22,11 +22,11 @@ MAILGUN_DOMAIN= DJANGO_AWS_ACCESS_KEY_ID= DJANGO_AWS_SECRET_ACCESS_KEY= DJANGO_AWS_STORAGE_BUCKET_NAME= -{% elif cookiecutter.cloud_provider == 'GCE' %} -# GCE +{% elif cookiecutter.cloud_provider == 'GCP' %} +# GCP # ------------------------------------------------------------------------------ GOOGLE_APPLICATION_CREDENTIALS= -DJANGO_GCE_STORAGE_BUCKET_NAME= +DJANGO_GCP_STORAGE_BUCKET_NAME= {% endif %} # django-allauth # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 1dbd2880..2c7b7a12 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -91,9 +91,9 @@ AWS_S3_OBJECT_PARAMETERS = { AWS_DEFAULT_ACL = None # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings AWS_S3_REGION_NAME = env("DJANGO_AWS_S3_REGION_NAME", default=None) -{% elif cookiecutter.cloud_provider == 'GCE' %} +{% elif cookiecutter.cloud_provider == 'GCP' %} DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" -GS_BUCKET_NAME = env("DJANGO_GCE_STORAGE_BUCKET_NAME") +GS_BUCKET_NAME = env("DJANGO_GCP_STORAGE_BUCKET_NAME") GS_DEFAULT_ACL = "publicRead" {% endif -%} @@ -106,7 +106,7 @@ STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" {% elif cookiecutter.cloud_provider == 'AWS' -%} STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" -{% elif cookiecutter.cloud_provider == 'GCE' -%} +{% elif cookiecutter.cloud_provider == 'GCP' -%} STATIC_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/static/" {% endif -%} @@ -131,7 +131,7 @@ class MediaRootS3Boto3Storage(S3Boto3Storage): # endregion DEFAULT_FILE_STORAGE = "config.settings.production.MediaRootS3Boto3Storage" MEDIA_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/media/" -{%- elif cookiecutter.cloud_provider == 'GCE' %} +{%- elif cookiecutter.cloud_provider == 'GCP' %} MEDIA_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/media/" MEDIA_ROOT = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/media/" {%- endif %} diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 43b20513..e8636fb8 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -15,7 +15,7 @@ sentry-sdk==0.8.0 # https://github.com/getsentry/sentry-python # ------------------------------------------------------------------------------ {%- if cookiecutter.cloud_provider == 'AWS' %} django-storages[boto3]==1.7.1 # https://github.com/jschneier/django-storages -{%- elif cookiecutter.cloud_provider == 'GCE' %} +{%- elif cookiecutter.cloud_provider == 'GCP' %} django-storages[google]==1.7.1 # https://github.com/jschneier/django-storages {%- endif %} django-anymail[mailgun]==6.0.1 # https://github.com/anymail/django-anymail