mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-22 01:26:57 +03:00
Use GCP acronym for Google Cloud Platform
This commit is contained in:
parent
007f3ffb31
commit
9a3a796a89
|
@ -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
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
],
|
||||
"cloud_provider": [
|
||||
"AWS",
|
||||
"GCE",
|
||||
"GCP",
|
||||
"None"
|
||||
],
|
||||
"custom_bootstrap_compilation": "n",
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
|
@ -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 %}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user