From 56aa332e0146ef94306ebac3f0fdacbd64fcb4fc Mon Sep 17 00:00:00 2001 From: Vlad Date: Sun, 14 Apr 2019 11:43:05 -0500 Subject: [PATCH 1/5] Documented Google Cloud Storage integration as an alternative to AWS S3 --- README.rst | 8 ++++++-- docs/project-generation-options.rst | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 2c037e51..fccbdaf9 100644 --- a/README.rst +++ b/README.rst @@ -47,7 +47,7 @@ Features * Comes with custom user model ready to go * Optional custom static build using Gulp and livereload * Send emails via Anymail_ (using Mailgun_ by default, but switchable) -* Media storage using Amazon S3 +* Media storage using Amazon S3 or Google Cloud Storage * Docker support using docker-compose_ for development and production (using Traefik_ with LetsEncrypt_ support) * Procfile_ for deploying to Heroku * Instructions for deploying to PythonAnywhere_ @@ -62,7 +62,7 @@ Optional Integrations *These features can be enabled during initial project setup.* -* Serve static files from Amazon S3 or Whitenoise_ +* Serve static files from Amazon S3, Google Cloud Storage or Whitenoise_ * Configuration for Celery_ and Flower_ (the latter in Docker setup only) * Integration with MailHog_ for local email testing * Integration with Sentry_ for error logging @@ -181,6 +181,10 @@ Answer the prompts with your own desired options_. For example:: 1 - None 2 - Gulp Choose from 1, 2 [1]: 1 + Select cloud_provider: + 1 - AWS + 2 - GCS + Choose from 1, 2 [1]: 1 custom_bootstrap_compilation [n]: n Select open_source_license: 1 - MIT diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index a5483797..82e9edc0 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -63,6 +63,12 @@ js_task_runner: 1. None 2. Gulp_ +cloud_provider: + Select a cloud provider for static files. The choices are: + + 1. AWS_ + 2. GCS_ + custom_bootstrap_compilation: Indicates whether the project should support Bootstrap recompilation via the selected JavaScript task runner's task. This can be useful From 7c8a473460f6c90a9773357aaec955b4591f5f65 Mon Sep 17 00:00:00 2001 From: Vlad Date: Sun, 14 Apr 2019 11:57:48 -0500 Subject: [PATCH 2/5] Updated settings.rst to reflect new GS env variable --- docs/settings.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/settings.rst b/docs/settings.rst index 212527cf..dd698a0d 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -45,6 +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 SENTRY_DSN SENTRY_DSN n/a raises error DJANGO_SENTRY_LOG_LEVEL SENTRY_LOG_LEVEL n/a logging.INFO MAILGUN_API_KEY MAILGUN_ACCESS_KEY n/a raises error From c041453bef94930c658edffe3f009b799d459a7d Mon Sep 17 00:00:00 2001 From: Vlad Date: Sun, 14 Apr 2019 12:07:37 -0500 Subject: [PATCH 3/5] Updated project-generation-options.rst to provide helpful links in case a user needs to decide between AWS s3 and GCS and added myself to contributors.rst --- CONTRIBUTORS.rst | 2 ++ docs/project-generation-options.rst | 3 +++ 2 files changed, 5 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 9486b3a0..ded1606b 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -177,6 +177,7 @@ Listed in alphabetical order. Travis McNeill `@Travistock`_ @tavistock_esq Tubo Shi `@Tubo`_ Umair Ashraf `@umrashrf`_ @fabumair + Vlad Doster `@vladdoster`_ Vitaly Babiy Vivian Guillen `@viviangb`_ Will Farley `@goldhand`_ @g01dhand @@ -315,6 +316,7 @@ Listed in alphabetical order. .. _@mrcoles: https://github.com/mrcoles .. _@ericgroom: https://github.com/ericgroom .. _@hanaquadara: https://github.com/hanaquadara +.. _@vladdoster: https://github.com/vladdoster Special Thanks ~~~~~~~~~~~~~~ diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index 82e9edc0..470ef949 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -121,6 +121,9 @@ debug: .. _Gulp: https://github.com/gulpjs/gulp +.. _AWS: https://aws.amazon.com/s3/ +.. _GCS: https://cloud.google.com/storage/ + .. _Django Compressor: https://github.com/django-compressor/django-compressor .. _Celery: https://github.com/celery/celery From f6cac35b8743407b788ea98b8b2c0444ed25df04 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 16 Apr 2019 11:23:41 -0500 Subject: [PATCH 4/5] Update docs/project-generation-options.rst Clearer diction describing cloud provider roles Co-Authored-By: vladdoster --- docs/project-generation-options.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index 470ef949..c9b3dff8 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -64,7 +64,7 @@ js_task_runner: 2. Gulp_ cloud_provider: - Select a cloud provider for static files. The choices are: + Select a cloud provider for static & media files. The choices are: 1. AWS_ 2. GCS_ From cd13ab4c823e3c9619c9deac5ca368b9af477a9a Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 16 Apr 2019 11:30:22 -0500 Subject: [PATCH 5/5] Update docs/settings.rst Documented GOOGLE_APPLICATION_CREDENTIALS env var Co-Authored-By: vladdoster --- docs/settings.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/settings.rst b/docs/settings.rst index dd698a0d..1830a47c 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -46,6 +46,7 @@ DJANGO_AWS_SECRET_ACCESS_KEY AWS_SECRET_ACCESS_KEY n/a 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 +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 MAILGUN_API_KEY MAILGUN_ACCESS_KEY n/a raises error