From 872204527f39386d687edf1e8ceffea56f76d211 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 17 May 2019 22:33:30 +0100 Subject: [PATCH 01/32] Remove user list view --- .../users/tests/test_urls.py | 5 ----- .../{{cookiecutter.project_slug}}/users/urls.py | 2 -- .../{{cookiecutter.project_slug}}/users/views.py | 12 +----------- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py index 20bd3dbad..c6361920d 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py @@ -13,11 +13,6 @@ def test_detail(user: settings.AUTH_USER_MODEL): assert resolve(f"/users/{user.username}/").view_name == "users:detail" -def test_list(): - assert reverse("users:list") == "/users/" - assert resolve("/users/").view_name == "users:list" - - def test_update(): assert reverse("users:update") == "/users/~update/" assert resolve("/users/~update/").view_name == "users:update" diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py index 2502a0c0c..eff24dd04 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py @@ -1,7 +1,6 @@ from django.urls import path from {{ cookiecutter.project_slug }}.users.views import ( - user_list_view, user_redirect_view, user_update_view, user_detail_view, @@ -9,7 +8,6 @@ from {{ cookiecutter.project_slug }}.users.views import ( app_name = "users" urlpatterns = [ - path("", view=user_list_view, name="list"), path("~redirect/", view=user_redirect_view, name="redirect"), path("~update/", view=user_update_view, name="update"), path("/", view=user_detail_view, name="detail"), diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py index 35e26e94f..a24427416 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py @@ -1,7 +1,7 @@ from django.contrib.auth import get_user_model from django.contrib.auth.mixins import LoginRequiredMixin from django.urls import reverse -from django.views.generic import DetailView, ListView, RedirectView, UpdateView +from django.views.generic import DetailView, RedirectView, UpdateView User = get_user_model() @@ -16,16 +16,6 @@ class UserDetailView(LoginRequiredMixin, DetailView): user_detail_view = UserDetailView.as_view() -class UserListView(LoginRequiredMixin, ListView): - - model = User - slug_field = "username" - slug_url_kwarg = "username" - - -user_list_view = UserListView.as_view() - - class UserUpdateView(LoginRequiredMixin, UpdateView): model = User From e6458d7c0732860479399d4429163af727ddfe00 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 17 May 2019 22:37:35 +0100 Subject: [PATCH 02/32] Update flake8 from 3.7.6 to 3.7.7 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 53d143788..02caf6eba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ black==19.3b0 -flake8==3.7.6 +flake8==3.7.7 # Testing # ------------------------------------------------------------------------------ From 99df05d8b0dc3b0b82167537e000b40cf67fc876 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 18 May 2019 12:00:28 +0100 Subject: [PATCH 03/32] Update sentry-sdk from 0.7.14 to 0.8.0 --- {{cookiecutter.project_slug}}/requirements/production.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 4ae99be3f..67c44c8fa 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==0.6.2 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.7.14 # https://github.com/getsentry/sentry-python +sentry-sdk==0.8.0 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 093455a120cf6e23b11816c588b60518e6b8e3f3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 18 May 2019 12:00:31 +0100 Subject: [PATCH 04/32] Update flake8 from 3.7.5 to 3.7.7 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 5fc26c15e..ddab6ab1d 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -17,7 +17,7 @@ pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality # ------------------------------------------------------------------------------ -flake8==3.7.5 # https://github.com/PyCQA/flake8 +flake8==3.7.7 # https://github.com/PyCQA/flake8 coverage==4.5.3 # https://github.com/nedbat/coveragepy black==19.3b0 # https://github.com/ambv/black pylint-django==2.0.9 # https://github.com/PyCQA/pylint-django From 88243d088d443c5fb9036cbe74f7f1d8ab4b6e0e Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 18 May 2019 13:08:30 +0100 Subject: [PATCH 05/32] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89e5d0153..449ce643b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All enhancements and patches to Cookiecutter Django will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2019-05-18] +### Removed +- Remove the user list view (@browniebroke) + ## [2019-05-17] ### Fixed - Added `LocaleMiddleware` to the list of middlewares (@tanoabeleyra) From 642c28792c0e697dfa618169e37722b185ade224 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 18 May 2019 13:22:50 +0100 Subject: [PATCH 06/32] Update Redis version to 5.0 --- {{cookiecutter.project_slug}}/local.yml | 2 +- {{cookiecutter.project_slug}}/production.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/local.yml b/{{cookiecutter.project_slug}}/local.yml index c6dd654e5..60f8f9228 100644 --- a/{{cookiecutter.project_slug}}/local.yml +++ b/{{cookiecutter.project_slug}}/local.yml @@ -45,7 +45,7 @@ services: {%- if cookiecutter.use_celery == 'y' %} redis: - image: redis:3.2 + image: redis:5.0 celeryworker: <<: *django diff --git a/{{cookiecutter.project_slug}}/production.yml b/{{cookiecutter.project_slug}}/production.yml index a24ba8297..331cbba68 100644 --- a/{{cookiecutter.project_slug}}/production.yml +++ b/{{cookiecutter.project_slug}}/production.yml @@ -44,7 +44,7 @@ services: - "0.0.0.0:443:443" redis: - image: redis:3.2 + image: redis:5.0 {%- if cookiecutter.use_celery == 'y' %} celeryworker: From d90406c3c3489c896407b09fada43ccfbae544a7 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 18 May 2019 14:06:05 +0100 Subject: [PATCH 07/32] Make the static storage use public ACL --- {{cookiecutter.project_slug}}/config/settings/production.py | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 61fb38d6e..6b79b0af7 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -117,6 +117,7 @@ from storages.backends.s3boto3 import S3Boto3Storage # noqa E402 class StaticRootS3Boto3Storage(S3Boto3Storage): location = "static" + default_acl = "public-read" class MediaRootS3Boto3Storage(S3Boto3Storage): From e74e2a8ad39dfde2712e5f508a294f9a0defb654 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 18 May 2019 14:08:02 +0100 Subject: [PATCH 08/32] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 449ce643b..51ad4472f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Removed - Remove the user list view (@browniebroke) +### Fixed +- Static storage default ACL (@browniebroke) + ## [2019-05-17] ### Fixed - Added `LocaleMiddleware` to the list of middlewares (@tanoabeleyra) From 98012829f3c5a2dbfa7962f744590685513de956 Mon Sep 17 00:00:00 2001 From: Matt Knapper Date: Sat, 18 May 2019 10:10:45 -0400 Subject: [PATCH 09/32] storageFile is deprecated, use storage instead --- CONTRIBUTORS.rst | 2 ++ .../compose/production/traefik/traefik.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index d11f99050..bd748062d 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -143,6 +143,7 @@ Listed in alphabetical order. Mateusz Ostaszewski `@mostaszewski`_ Mathijs Hoogland `@MathijsHoogland`_ Matt Braymer-Hayes `@mattayes`_ @mattayes + Matt Knapper `@mknapper1`_ Matt Linares Matt Menzenski `@menzenski`_ Matt Warren `@mfwarren`_ @@ -260,6 +261,7 @@ Listed in alphabetical order. .. _@msaizar: https://github.com/msaizar .. _@MathijsHoogland: https://github.com/MathijsHoogland .. _@mattayes: https://github.com/mattayes +.. _@mknapper1: https://github.com/mknapper1 .. _@menzenski: https://github.com/menzenski .. _@mostaszewski: https://github.com/mostaszewski .. _@mfwarren: https://github.com/mfwarren diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.toml b/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.toml index ad1f20e9e..0f2abe8a1 100644 --- a/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.toml +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.toml @@ -17,7 +17,7 @@ defaultEntryPoints = ["http", "https"] [acme] # Email address used for registration email = "{{ cookiecutter.email }}" -storageFile = "/etc/traefik/acme/acme.json" +storage = "/etc/traefik/acme/acme.json" entryPoint = "https" onDemand = false OnHostRule = true From 570930ef135ce4d195b02167764ecbc74d27fb69 Mon Sep 17 00:00:00 2001 From: shireenrao Date: Sat, 18 May 2019 22:49:10 -0400 Subject: [PATCH 10/32] If using whitenoise disable AWS and GCE for static If using whitenoise disable AWS and GCE for static setting. --- {{cookiecutter.project_slug}}/config/settings/production.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 6b79b0af7..0c94b2d8c 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -99,11 +99,10 @@ GS_DEFAULT_ACL = "publicRead" # ------------------------ {% if cookiecutter.use_whitenoise == 'y' -%} STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" -{%- endif -%} -{%- if cookiecutter.cloud_provider == 'AWS' %} +{%- elif cookiecutter.cloud_provider == 'AWS' and cookiecutter.use_whitenoise == 'n' %} 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 == 'GCE' and cookiecutter.use_whitenoise == 'n' %} STATIC_URL = "https://storage.googleapis.com/{}/static/".format(GS_BUCKET_NAME) {%- endif %} From 0b732298e5d4e4be6569c3903aeef9f697fc4b69 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 19 May 2019 12:00:27 +0100 Subject: [PATCH 11/32] Update django-extensions from 2.1.6 to 2.1.7 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index ddab6ab1d..24cedfda3 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -30,6 +30,6 @@ pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery factory-boy==2.12.0 # https://github.com/FactoryBoy/factory_boy django-debug-toolbar==1.11 # https://github.com/jazzband/django-debug-toolbar -django-extensions==2.1.6 # https://github.com/django-extensions/django-extensions +django-extensions==2.1.7 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin pytest-django==3.4.8 # https://github.com/pytest-dev/pytest-django From adcc5d0b2889a59aa7e79f8d17e521ed92bee32c Mon Sep 17 00:00:00 2001 From: shireenrao Date: Sun, 19 May 2019 08:27:14 -0400 Subject: [PATCH 12/32] Update {{cookiecutter.project_slug}}/config/settings/production.py Co-Authored-By: Bruno Alla --- {{cookiecutter.project_slug}}/config/settings/production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 0c94b2d8c..203612ca1 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -99,7 +99,7 @@ GS_DEFAULT_ACL = "publicRead" # ------------------------ {% if cookiecutter.use_whitenoise == 'y' -%} STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" -{%- elif cookiecutter.cloud_provider == 'AWS' and cookiecutter.use_whitenoise == 'n' %} +{%- 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' and cookiecutter.use_whitenoise == 'n' %} From 8c69a1203f22ca996c5f2b47ea65e3c51f874ce0 Mon Sep 17 00:00:00 2001 From: shireenrao Date: Sun, 19 May 2019 08:27:28 -0400 Subject: [PATCH 13/32] Update {{cookiecutter.project_slug}}/config/settings/production.py Co-Authored-By: Bruno Alla --- {{cookiecutter.project_slug}}/config/settings/production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 203612ca1..1a5889d5d 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -102,7 +102,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' and cookiecutter.use_whitenoise == 'n' %} +{%- elif cookiecutter.cloud_provider == 'GCE' %} STATIC_URL = "https://storage.googleapis.com/{}/static/".format(GS_BUCKET_NAME) {%- endif %} From de7be3652a82172a45197ab92394e1bd0fa15500 Mon Sep 17 00:00:00 2001 From: Tano Abeleyra Date: Sat, 18 May 2019 20:23:48 -0300 Subject: [PATCH 14/32] Make cloud_provider optional Some projects may not need AWS or GCS --- README.rst | 3 ++- cookiecutter.json | 3 ++- docs/project-generation-options.rst | 1 + hooks/post_gen_project.py | 6 ++++++ tests/test_cookiecutter_generation.py | 2 +- {{cookiecutter.project_slug}}/config/settings/production.py | 4 +++- 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 8a92eddae..efcfd506a 100644 --- a/README.rst +++ b/README.rst @@ -185,7 +185,8 @@ Answer the prompts with your own desired options_. For example:: Select cloud_provider: 1 - AWS 2 - GCS - Choose from 1, 2 [1]: 1 + 3 - None + Choose from 1, 2, 3 [1]: 1 custom_bootstrap_compilation [n]: n Select open_source_license: 1 - MIT diff --git a/cookiecutter.json b/cookiecutter.json index a66bb732a..d4a977bb1 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -33,7 +33,8 @@ ], "cloud_provider": [ "AWS", - "GCE" + "GCE", + "None" ], "custom_bootstrap_compilation": "n", "use_compressor": "n", diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index c3c4d3a2d..3e4ac47c4 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -69,6 +69,7 @@ cloud_provider: 1. AWS_ 2. GCS_ + 3. None custom_bootstrap_compilation: Indicates whether the project should support Bootstrap recompilation diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 292f6e7f6..ff84f1806 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -328,6 +328,12 @@ def main(): if "{{ cookiecutter.use_docker }}".lower() == "y": remove_node_dockerfile() + if "{{ cookiecutter.cloud_provider}}".lower() == "none": + print( + WARNING + "You chose not to use a cloud provider, " + "media files won't be served in production." + TERMINATOR + ) + if "{{ cookiecutter.use_celery }}".lower() == "n": remove_celery_files() if "{{ cookiecutter.use_docker }}".lower() == "y": diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index 2be23b86a..be05e79b1 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -11,7 +11,7 @@ PATTERN = "{{(\s?cookiecutter)[.](.*?)}}" RE_OBJ = re.compile(PATTERN) YN_CHOICES = ["y", "n"] -CLOUD_CHOICES = ["AWS", "GCE"] +CLOUD_CHOICES = ["AWS", "GCE", "None"] @pytest.fixture diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 1a5889d5d..c2fcd5750 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -68,8 +68,10 @@ SECURE_CONTENT_TYPE_NOSNIFF = env.bool( # STORAGES # ------------------------------------------------------------------------------ +{% if cookiecutter.cloud_provider != 'None' -%} # https://django-storages.readthedocs.io/en/latest/#installation INSTALLED_APPS += ["storages"] # noqa F405 +{%- endif -%} {% if cookiecutter.cloud_provider == 'AWS' %} # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings AWS_ACCESS_KEY_ID = env("DJANGO_AWS_ACCESS_KEY_ID") @@ -193,7 +195,7 @@ COMPRESS_ENABLED = env.bool("COMPRESS_ENABLED", default=True) # https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_STORAGE COMPRESS_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" # https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_URL -COMPRESS_URL = STATIC_URL{% if cookiecutter.use_whitenoise == 'y' %} # noqa F405{% endif %} +COMPRESS_URL = STATIC_URL{% if cookiecutter.use_whitenoise == 'y' or cookiecutter.cloud_provider == 'None' %} # noqa F405{% endif %} {% endif %} {%- if cookiecutter.use_whitenoise == 'n' -%} # Collectfast From 2116f997bcb11e6ca00b4c09e07546b606f677b3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 20 May 2019 12:00:32 +0100 Subject: [PATCH 15/32] Update django-anymail from 6.0 to 6.0.1 --- {{cookiecutter.project_slug}}/requirements/production.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 67c44c8fa..e62eeb73c 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -18,4 +18,4 @@ django-storages[boto3]==1.7.1 # https://github.com/jschneier/django-storages {%- elif cookiecutter.cloud_provider == 'GCE' %} django-storages[google]==1.7.1 # https://github.com/jschneier/django-storages {%- endif %} -django-anymail[mailgun]==6.0 # https://github.com/anymail/django-anymail +django-anymail[mailgun]==6.0.1 # https://github.com/anymail/django-anymail From 4bf795a908d49cf0135625990006baa568393fdb Mon Sep 17 00:00:00 2001 From: Curtis St Pierre Date: Sun, 19 May 2019 21:29:15 -0700 Subject: [PATCH 16/32] 1989 - reworked postgres version options --- CONTRIBUTORS.rst | 26 ++++++++++++++------------ README.rst | 17 +++++++---------- cookiecutter.json | 7 ++----- docs/project-generation-options.rst | 15 ++++++--------- 4 files changed, 29 insertions(+), 36 deletions(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index bd748062d..7a9dbf79c 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -7,19 +7,19 @@ Core Developers These contributors have commit flags for the repository, and are able to accept and merge pull requests. -=========================== ================ =========== -Name Github Twitter -=========================== ================ =========== -Daniel Roy Greenfeld `@pydanny`_ @pydanny -Audrey Roy Greenfeld* `@audreyr`_ @audreyr -Fábio C. Barrionuevo da Luz `@luzfcb`_ @luzfcb -Saurabh Kumar `@theskumar`_ @_theskumar +=========================== ================= =========== +Name Github Twitter +=========================== ================= =========== +Daniel Roy Greenfeld `@pydanny`_ @pydanny +Audrey Roy Greenfeld* `@audreyr`_ @audreyr +Fábio C. Barrionuevo da Luz `@luzfcb`_ @luzfcb +Saurabh Kumar `@theskumar`_ @_theskumar Jannis Gebauer `@jayfk`_ -Burhan Khalid `@burhan`_ @burhan -Nikita Shupeyko `@webyneter`_ @webyneter -Bruno Alla               `@browniebroke`_ @_BrunoAlla -Wan Liuyang `@sfdye`_ @sfdye -=========================== ================ =========== +Burhan Khalid `@burhan`_ @burhan +Nikita Shupeyko `@webyneter`_ @webyneter +Bruno Alla               `@browniebroke`_ @_BrunoAlla +Wan Liuyang `@sfdye`_ @sfdye +=========================== ================= =========== *Audrey is also the creator of Cookiecutter. Audrey and Daniel are on the Cookiecutter core team.* @@ -87,6 +87,7 @@ Listed in alphabetical order. Craig Margieson `@cmargieson`_ Cristian Vargas `@cdvv7788`_ Cullen Rhodes `@c-rhodes`_ + Curtis St Pierre `@curtisstpierre`_ @cstpierre1388 Dan Shultz `@shultz`_ Daniel Hepper `@dhepper`_ @danielhepper Daniele Tricoli `@eriol`_ @@ -222,6 +223,7 @@ Listed in alphabetical order. .. _@chuckus: https://github.com/chuckus .. _@cmackenzie1: https://github.com/cmackenzie1 .. _@Collederas: https://github.com/Collederas +.. _@curtisstpierre: https://github.com/curtisstpierre .. _@davitovmasyan: https://github.com/davitovmasyan .. _@ddiazpinto: https://github.com/ddiazpinto .. _@demestav: https://github.com/demestav diff --git a/README.rst b/README.rst index 8a92eddae..d6372de68 100644 --- a/README.rst +++ b/README.rst @@ -89,7 +89,7 @@ Constraints ----------- * Only maintained 3rd party libraries are used. -* Uses PostgreSQL everywhere (9.4 - 10.5) +* Uses PostgreSQL everywhere (9.4 - 11.3) * Environment variables for configuration (This won't work with Apache/mod_wsgi). Support this Project! @@ -169,15 +169,12 @@ Answer the prompts with your own desired options_. For example:: use_heroku [n]: y use_compressor [n]: y Select postgresql_version: - 1 - 10.5 - 2 - 10.4 - 3 - 10.3 - 4 - 10.2 - 5 - 10.1 - 6 - 9.6 - 7 - 9.5 - 8 - 9.4 - Choose from 1, 2, 3, 4, 5, 6, 7, 8 [1]: 1 + 1 - 11.3 + 2 - 10.8 + 3 - 9.6 + 4 - 9.5 + 5 - 9.4 + Choose from 1, 2, 3, 4, 5 [1]: 1 Select js_task_runner: 1 - None 2 - Gulp diff --git a/cookiecutter.json b/cookiecutter.json index a66bb732a..cfb20f6be 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -18,11 +18,8 @@ "use_pycharm": "n", "use_docker": "n", "postgresql_version": [ - "10.5", - "10.4", - "10.3", - "10.2", - "10.1", + "11.3", + "10.8", "9.6", "9.5", "9.4" diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index c3c4d3a2d..6f2a2f224 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -49,14 +49,11 @@ use_docker: postgresql_version: Select a PostgreSQL_ version to use. The choices are: - 1. 10.5 - 2. 10.4 - 3. 10.3 - 4. 10.2 - 5. 10.1 - 6. 9.6 - 7. 9.5 - 8. 9.4 + 1. 11.3 + 2. 10.8 + 3. 9.6 + 4. 9.5 + 5. 9.4 js_task_runner: Select a JavaScript task runner. The choices are: @@ -100,7 +97,7 @@ use_travisci: keep_local_envs_in_vcs: Indicates whether the project's ``.envs/.local/`` should be kept in VCS (comes in handy when working in teams where local environment reproducibility - is strongly encouraged). + is strongly encouraged). Note: .env(s) are only utilized when Docker Compose and/or Heroku support is enabled. debug: From 38b2c2dfcd44fa7e103c12a276fdc1db4bc1b728 Mon Sep 17 00:00:00 2001 From: Demetris Stavrou <1180929+demestav@users.noreply.github.com> Date: Tue, 21 May 2019 22:04:03 +0300 Subject: [PATCH 17/32] Errors are now sent to Sentry --- {{cookiecutter.project_slug}}/config/settings/production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 1a5889d5d..a132b3b2a 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -288,7 +288,7 @@ SENTRY_LOG_LEVEL = env.int("DJANGO_SENTRY_LOG_LEVEL", logging.INFO) sentry_logging = LoggingIntegration( level=SENTRY_LOG_LEVEL, # Capture info and above as breadcrumbs - event_level=None, # Send no events from log messages + event_level=logging.ERROR # Send errors as events ) {%- if cookiecutter.use_celery == 'y' %} From 7cc94c139c81c5ab10e708a23e1e64c086a5fabe Mon Sep 17 00:00:00 2001 From: Demetris Stavrou <1180929+demestav@users.noreply.github.com> Date: Tue, 21 May 2019 22:44:10 +0300 Subject: [PATCH 18/32] Updated documentation --- docs/deployment-with-docker.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/deployment-with-docker.rst b/docs/deployment-with-docker.rst index aad549327..e69abc010 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -35,7 +35,15 @@ Configuring the Stack The majority of services above are configured through the use of environment variables. Just check out :ref:`envs` and you will know the drill. -To obtain logs and information about crashes in a production setup, make sure that you have access to an external Sentry instance (e.g. by creating an account with `sentry.io`_), and set the ``SENTRY_DSN`` variable. +To obtain logs and information about crashes in a production setup, make sure that you have access to an external Sentry instance (e.g. by creating an account with `sentry.io`_), and set the ``SENTRY_DSN`` variable. Logs of level `logging.ERROR` are sent as Sentry events. Therefore, in order to send a Sentry even use: + +.. code-block:: python + + import logging + logging.error("This event is sent to Sentry", extra={"": ""}) + +The `extra` parameter allows you to send additional information about the context of this error. + You will probably also need to setup the Mail backend, for example by adding a `Mailgun`_ API key and a `Mailgun`_ sender domain, otherwise, the account creation view will crash and result in a 500 error when the backend attempts to send an email to the account owner. From a37046d1ef9a64642138998a9239023ccd7097b6 Mon Sep 17 00:00:00 2001 From: shireenrao Date: Tue, 21 May 2019 18:17:19 -0400 Subject: [PATCH 19/32] Revert Werkzeug back to 0.14 reverting back Werkzeug to version 0.14 based on discussion on #2070 I did the change locally on my windows laptop and can confirm that this is now working. --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 24cedfda3..57a262c96 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,6 +1,6 @@ -r ./base.txt -Werkzeug==0.15.4 # https://github.com/pallets/werkzeug +Werkzeug==0.14 # https://github.com/pallets/werkzeug ipdb==0.12 # https://github.com/gotcha/ipdb Sphinx==2.0.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} From a636d454f619018333d4fd9cd32918fc3ea2beaa Mon Sep 17 00:00:00 2001 From: Demetris Stavrou <1180929+demestav@users.noreply.github.com> Date: Wed, 22 May 2019 09:46:20 +0300 Subject: [PATCH 20/32] Update {{cookiecutter.project_slug}}/config/settings/production.py Co-Authored-By: Bruno Alla --- {{cookiecutter.project_slug}}/config/settings/production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index a132b3b2a..85b17f1b4 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -288,7 +288,7 @@ SENTRY_LOG_LEVEL = env.int("DJANGO_SENTRY_LOG_LEVEL", logging.INFO) sentry_logging = LoggingIntegration( level=SENTRY_LOG_LEVEL, # Capture info and above as breadcrumbs - event_level=logging.ERROR # Send errors as events + event_level=logging.ERROR, # Send errors as events ) {%- if cookiecutter.use_celery == 'y' %} From 61c842cd9dd919c33ea927b836660a68ad4bf391 Mon Sep 17 00:00:00 2001 From: Demetris Stavrou <1180929+demestav@users.noreply.github.com> Date: Wed, 22 May 2019 09:47:03 +0300 Subject: [PATCH 21/32] Update docs/deployment-with-docker.rst Co-Authored-By: Bruno Alla --- docs/deployment-with-docker.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deployment-with-docker.rst b/docs/deployment-with-docker.rst index e69abc010..038778cfb 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -35,7 +35,7 @@ Configuring the Stack The majority of services above are configured through the use of environment variables. Just check out :ref:`envs` and you will know the drill. -To obtain logs and information about crashes in a production setup, make sure that you have access to an external Sentry instance (e.g. by creating an account with `sentry.io`_), and set the ``SENTRY_DSN`` variable. Logs of level `logging.ERROR` are sent as Sentry events. Therefore, in order to send a Sentry even use: +To obtain logs and information about crashes in a production setup, make sure that you have access to an external Sentry instance (e.g. by creating an account with `sentry.io`_), and set the ``SENTRY_DSN`` variable. Logs of level `logging.ERROR` are sent as Sentry events. Therefore, in order to send a Sentry event use: .. code-block:: python From 9e27e853f2c20e319559b39b715e346dbe901779 Mon Sep 17 00:00:00 2001 From: shireenrao Date: Wed, 22 May 2019 09:44:36 -0400 Subject: [PATCH 22/32] update Werkzeug to 0.14.1 and add pyup filter --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 57a262c96..7f856f28c 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,6 +1,6 @@ -r ./base.txt -Werkzeug==0.14 # https://github.com/pallets/werkzeug +Werkzeug==0.14.1 # pyup: < 0.15 # https://github.com/pallets/werkzeug ipdb==0.12 # https://github.com/gotcha/ipdb Sphinx==2.0.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} From 4054105d63b04fc938073c039c6e43765ffd5c7e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 23 May 2019 20:33:13 -0700 Subject: [PATCH 23/32] Update tox from 3.11.1 to 3.12.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 02caf6eba..4a6b4b598 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ flake8==3.7.7 # Testing # ------------------------------------------------------------------------------ -tox==3.11.1 +tox==3.12.1 pytest==4.5.0 pytest_cases==1.6.2 pytest-cookies==0.3.0 From a67587bb24cbbd87505fefdf9d62b81408eab00b Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 25 May 2019 16:53:08 +0200 Subject: [PATCH 24/32] Bring psycopg2 versions in line --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 7f856f28c..2e2228c39 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -4,7 +4,7 @@ Werkzeug==0.14.1 # pyup: < 0.15 # https://github.com/pallets/werkzeug ipdb==0.12 # https://github.com/gotcha/ipdb Sphinx==2.0.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} -psycopg2==2.8 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 +psycopg2==2.8.2 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} psycopg2-binary==2.8.2 # https://github.com/psycopg/psycopg2 {%- endif %} From 729dddcab6afacdce49f5ce200af1c1b97ebbbea Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 25 May 2019 16:53:34 +0200 Subject: [PATCH 25/32] Bring psycopg2 versions in line --- {{cookiecutter.project_slug}}/requirements/production.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index e62eeb73c..43b20513d 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -3,7 +3,7 @@ -r ./base.txt gunicorn==19.9.0 # https://github.com/benoitc/gunicorn -psycopg2==2.8 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 +psycopg2==2.8.2 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} Collectfast==0.6.2 # https://github.com/antonagestam/collectfast {%- endif %} From c96c932111442aaf336f0649b6445561d39961d9 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 14:46:07 +0100 Subject: [PATCH 26/32] Correct name for Celery worker-related settings - fix #2080 The settings which are normally prefixed `CELERYD_` are for worker-related config, but since we instantiate the Celery app with a namespace, the prefix for these config should actually be `CELERY_`. --- {{cookiecutter.project_slug}}/config/settings/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index b72b7f00d..4a522fdda 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -266,10 +266,10 @@ CELERY_TASK_SERIALIZER = "json" CELERY_RESULT_SERIALIZER = "json" # http://docs.celeryproject.org/en/latest/userguide/configuration.html#task-time-limit # TODO: set to whatever value is adequate in your circumstances -CELERYD_TASK_TIME_LIMIT = 5 * 60 +CELERY_TASK_TIME_LIMIT = 5 * 60 # http://docs.celeryproject.org/en/latest/userguide/configuration.html#task-soft-time-limit # TODO: set to whatever value is adequate in your circumstances -CELERYD_TASK_SOFT_TIME_LIMIT = 60 +CELERY_TASK_SOFT_TIME_LIMIT = 60 {%- endif %} # django-allauth From b4cea81f260b686be0678706fa60da4067c86669 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 15:55:41 +0100 Subject: [PATCH 27/32] Fix some comment and empty lines in settings --- {{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 d9771e598..476e0dff1 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -66,9 +66,9 @@ SECURE_CONTENT_TYPE_NOSNIFF = env.bool( "DJANGO_SECURE_CONTENT_TYPE_NOSNIFF", default=True ) +{% if cookiecutter.cloud_provider != 'None' -%} # STORAGES # ------------------------------------------------------------------------------ -{% if cookiecutter.cloud_provider != 'None' -%} # https://django-storages.readthedocs.io/en/latest/#installation INSTALLED_APPS += ["storages"] # noqa F405 {%- endif -%} @@ -101,10 +101,10 @@ GS_DEFAULT_ACL = "publicRead" # ------------------------ {% if cookiecutter.use_whitenoise == 'y' -%} STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" -{%- elif cookiecutter.cloud_provider == 'AWS' %} +{% 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 == 'GCE' -%} STATIC_URL = "https://storage.googleapis.com/{}/static/".format(GS_BUCKET_NAME) {%- endif %} From 881a6fd681abe83dd2a6b4f83782312e7e8ee96f Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 15:58:56 +0100 Subject: [PATCH 28/32] Change GCP settings to f-strings --- {{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 476e0dff1..6fd0eac9d 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -105,7 +105,7 @@ STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" {% elif cookiecutter.cloud_provider == 'GCE' -%} -STATIC_URL = "https://storage.googleapis.com/{}/static/".format(GS_BUCKET_NAME) +STATIC_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/static/" {%- endif %} # MEDIA @@ -130,8 +130,8 @@ class MediaRootS3Boto3Storage(S3Boto3Storage): DEFAULT_FILE_STORAGE = "config.settings.production.MediaRootS3Boto3Storage" MEDIA_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/media/" {%- elif cookiecutter.cloud_provider == 'GCE' %} -MEDIA_URL = "https://storage.googleapis.com/{}/media/".format(GS_BUCKET_NAME) -MEDIA_ROOT = "https://storage.googleapis.com/{}/media/".format(GS_BUCKET_NAME) +MEDIA_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/media/" +MEDIA_ROOT = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/media/" {%- endif %} # TEMPLATES From 4b1239426cff1dc380e60ad3cc264cde193856b5 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 16:20:29 +0100 Subject: [PATCH 29/32] Add custom markers to pytest config --- pytest.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pytest.ini b/pytest.ini index c5b301991..01c7b1bfc 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,3 +1,6 @@ [pytest] python_paths = . norecursedirs = .tox .git */migrations/* */static/* docs venv */{{cookiecutter.project_slug}}/* +markers = + flake8: Run flake8 on all possible template combinations + black: Run black on all possible template combinations From b56071f516e9201d957dd9bc5691af339d15fbde Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 16:33:07 +0100 Subject: [PATCH 30/32] Fix comments and empty lines in prod settings --- {{cookiecutter.project_slug}}/config/settings/production.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 6fd0eac9d..1dbd28801 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -95,10 +95,12 @@ AWS_S3_REGION_NAME = env("DJANGO_AWS_S3_REGION_NAME", default=None) DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" GS_BUCKET_NAME = env("DJANGO_GCE_STORAGE_BUCKET_NAME") GS_DEFAULT_ACL = "publicRead" -{% endif %} +{% endif -%} +{% if cookiecutter.cloud_provider != 'None' or cookiecutter.use_whitenoise == 'y' -%} # STATIC # ------------------------ +{% endif -%} {% if cookiecutter.use_whitenoise == 'y' -%} STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" {% elif cookiecutter.cloud_provider == 'AWS' -%} @@ -106,7 +108,7 @@ STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" {% elif cookiecutter.cloud_provider == 'GCE' -%} STATIC_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/static/" -{%- endif %} +{% endif -%} # MEDIA # ------------------------------------------------------------------------------ From 47937fce7984bc7c5f0e83d4b24f96dbedef5d86 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 16:54:08 +0100 Subject: [PATCH 31/32] Fix deprecation warning in tests --- tests/test_cookiecutter_generation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index be05e79b1..4292f989b 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -7,7 +7,7 @@ import sh import yaml from binaryornot.check import is_binary -PATTERN = "{{(\s?cookiecutter)[.](.*?)}}" +PATTERN = r"{{(\s?cookiecutter)[.](.*?)}}" RE_OBJ = re.compile(PATTERN) YN_CHOICES = ["y", "n"] From 761720bce79e8f68db6e0e409d74e906b35d9c0e Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 16:57:55 +0100 Subject: [PATCH 32/32] Prepare 2.1.8-01 tag --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 65bcd8fcf..e46cdb883 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ except ImportError: # Our version ALWAYS matches the version of Django we support # If Django has a new release, we branch, tag, then update this setting after the tag. -version = "2.0.2" +version = "2.1.8-01" if sys.argv[-1] == "tag": os.system('git tag -a %s -m "version %s"' % (version, version))