From 5e196b45e9f6c1b45b30e942df38526b53587f36 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 10 Oct 2019 11:36:48 +0100 Subject: [PATCH 01/15] Pin Traefik Docker image to v1 Until we do the required changes to update to v2. Fixes #2258 --- .../compose/production/traefik/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile index 7088e6fe3..d7363a1af 100644 --- a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile @@ -1,4 +1,4 @@ -FROM traefik:alpine +FROM traefik:1.7-alpine RUN mkdir -p /etc/traefik/acme RUN touch /etc/traefik/acme/acme.json RUN chmod 600 /etc/traefik/acme/acme.json From 96ade99c66c396ec2cac70f93cb173ef8ec2208c Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 20 Oct 2019 12:00:29 +0100 Subject: [PATCH 02/15] Update psycopg2-binary from 2.8.3 to 2.8.4 --- {{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 dd795609e..c7e9aa924 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -6,7 +6,7 @@ Sphinx==2.2.0 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} -psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 +psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 {%- endif %} # Testing From 58f41fc97f9fc1ebf6853c7855a9450d9c92e8f1 Mon Sep 17 00:00:00 2001 From: Jelmert Date: Mon, 21 Oct 2019 09:59:37 +0200 Subject: [PATCH 03/15] fix: remove the aws Dockerfile and remove the awscli definition from production.yml when not selected --- hooks/post_gen_project.py | 7 +++++++ {{cookiecutter.project_slug}}/production.yml | 3 +++ 2 files changed, 10 insertions(+) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index ff84f1806..95815564f 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -279,6 +279,10 @@ def remove_node_dockerfile(): shutil.rmtree(os.path.join("compose", "local", "node")) +def remove_aws_dockerfile(): + shutil.rmtree(os.path.join("compose", "production", "aws")) + + def main(): debug = "{{ cookiecutter.debug }}".lower() == "y" @@ -302,6 +306,9 @@ def main(): else: remove_docker_files() + if "{{ cookiecutter.use_docker }}".lower() == "y" and "{{ cookiecutter.cloud_provider}}".lower() != 'aws': + remove_aws_dockerfile() + if "{{ cookiecutter.use_heroku }}".lower() == "n": remove_heroku_files() diff --git a/{{cookiecutter.project_slug}}/production.yml b/{{cookiecutter.project_slug}}/production.yml index 331cbba68..62ec9d829 100644 --- a/{{cookiecutter.project_slug}}/production.yml +++ b/{{cookiecutter.project_slug}}/production.yml @@ -65,6 +65,8 @@ services: command: /start-flower {%- endif %} + + {% if cookiecutter.cloud_provider == 'AWS' %} awscli: build: context: . @@ -73,3 +75,4 @@ services: - ./.envs/.production/.django volumes: - production_postgres_data_backups:/backups + {%- endif %} From eb8ea447e488df634373e44de36e4aad7fd2dfb3 Mon Sep 17 00:00:00 2001 From: Jelmert Date: Mon, 21 Oct 2019 11:12:53 +0200 Subject: [PATCH 04/15] fix: black --- hooks/post_gen_project.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 95815564f..0544f14bc 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -306,7 +306,10 @@ def main(): else: remove_docker_files() - if "{{ cookiecutter.use_docker }}".lower() == "y" and "{{ cookiecutter.cloud_provider}}".lower() != 'aws': + if ( + "{{ cookiecutter.use_docker }}".lower() == "y" + and "{{ cookiecutter.cloud_provider}}".lower() != "aws" + ): remove_aws_dockerfile() if "{{ cookiecutter.use_heroku }}".lower() == "n": From 8cce6df70aae9ce59ca746dd2419a9d284e254cf Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 21 Oct 2019 12:00:32 +0100 Subject: [PATCH 05/15] Update django-extensions from 2.2.3 to 2.2.5 --- {{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 dd795609e..1068b1947 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==2.0 # https://github.com/jazzband/django-debug-toolbar -django-extensions==2.2.3 # https://github.com/django-extensions/django-extensions +django-extensions==2.2.5 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin pytest-django==3.6.0 # https://github.com/pytest-dev/pytest-django From 400fcc4030fec8cff85cca30082a70977fb14716 Mon Sep 17 00:00:00 2001 From: Yuchen Xie Date: Tue, 22 Oct 2019 10:20:00 +0800 Subject: [PATCH 06/15] Prevent collectfast from guessing a wrong strategy If `COLLECTFAST_STRATEGY` is not provided in `settings`, `collectfast` has to guess a "strategy". For the case with AWS, it guesses `BotoStrategy` in stead of `S3Boto3Storage`, which is a wrong decision as we `pip install django-storages[boto3]` (`boto3` in favor of `boto`). Setting `COLLECTFAST_STRATEGY` is also encouraged as `collectfast` is not going to guess the strategy in the future. Ref: * https://github.com/antonagestam/collectfast/blob/f37dd1faa2046a2ebb88c098eb03e56a95534ec6/collectfast/management/commands/collectstatic.py#L33 * https://github.com/antonagestam/collectfast/blob/f37dd1faa2046a2ebb88c098eb03e56a95534ec6/collectfast/strategies/base.py#L170 --- CONTRIBUTORS.rst | 2 ++ {{cookiecutter.project_slug}}/config/settings/production.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 3a3930b2e..90bb63952 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -200,6 +200,7 @@ Listed in alphabetical order. William Archinal `@archinal`_ Xaver Y.R. Chen `@yrchen`_ @yrchen Yaroslav Halchenko + Yuchen Xie `@mapx`_ ========================== ============================ ============== .. _@a7p: https://github.com/a7p @@ -291,6 +292,7 @@ Listed in alphabetical order. .. _@knitatoms: https://github.com/knitatoms .. _@krzysztofzuraw: https://github.com/krzysztofzuraw .. _@MathijsHoogland: https://github.com/MathijsHoogland +.. _@mapx: https://github.com/mapx .. _@mattayes: https://github.com/mattayes .. _@menzenski: https://github.com/menzenski .. _@mfwarren: https://github.com/mfwarren diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 7a5d5454d..712f2bf4a 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -104,9 +104,11 @@ GS_DEFAULT_ACL = "publicRead" STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" {% elif cookiecutter.cloud_provider == 'AWS' -%} STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" +COLLECTFAST_STRATEGY = "collectfast.strategies.boto3.Boto3Strategy" STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" {% elif cookiecutter.cloud_provider == 'GCP' -%} STATICFILES_STORAGE = "config.settings.production.StaticRootGoogleCloudStorage" +COLLECTFAST_STRATEGY = "collectfast.strategies.gcloud.GoogleCloudStrategy" STATIC_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/static/" {% endif -%} From 998733411c7340a451c4099bd93f4d23c24b8eaf Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 22 Oct 2019 12:00:35 +0100 Subject: [PATCH 07/15] Update pillow from 6.2.0 to 6.2.1 --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 9bf874070..efff1c480 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,6 +1,6 @@ pytz==2019.3 # https://github.com/stub42/pytz python-slugify==3.0.6 # https://github.com/un33k/python-slugify -Pillow==6.2.0 # https://github.com/python-pillow/Pillow +Pillow==6.2.1 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin {%- endif %} From 3f0134a64b2dd148af1e59de4ce75780096f5d2b Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 23 Oct 2019 12:00:31 +0100 Subject: [PATCH 08/15] Update collectfast from 1.2.0 to 1.3.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 10d1ea5b5..a036e77ec 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -5,7 +5,7 @@ gunicorn==19.9.0 # https://github.com/benoitc/gunicorn psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} -Collectfast==1.2.0 # https://github.com/antonagestam/collectfast +Collectfast==1.3.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} sentry-sdk==0.13.0 # https://github.com/getsentry/sentry-python From 662ca222054e0acbbfac6aae1fae1dc7e6f5a264 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 24 Oct 2019 12:00:29 +0100 Subject: [PATCH 09/15] Update pytest_cases from 1.11.3 to 1.11.4 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index efc3d1176..c90fb4cd3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8==3.7.8 # ------------------------------------------------------------------------------ tox==3.14.0 pytest==5.2.1 -pytest_cases==1.11.3 +pytest_cases==1.11.4 pytest-cookies==0.4.0 pytest-xdist==1.30.0 pyyaml==5.1.2 From bd61b797325d3545801940ca5a3013d05ede52d4 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 25 Oct 2019 12:00:36 +0100 Subject: [PATCH 10/15] Update pytest from 5.2.1 to 5.2.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index efc3d1176..0614fa8f4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.8 # Testing # ------------------------------------------------------------------------------ tox==3.14.0 -pytest==5.2.1 +pytest==5.2.2 pytest_cases==1.11.3 pytest-cookies==0.4.0 pytest-xdist==1.30.0 From c2aa615fdc1c94d8d1a1ef8f33b5859ef7c6d6e4 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 25 Oct 2019 12:00:37 +0100 Subject: [PATCH 11/15] Update pytest from 5.2.1 to 5.2.2 --- {{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 1d08dcb75..5dfff7ea1 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.740 # https://github.com/python/mypy -pytest==5.2.1 # https://github.com/pytest-dev/pytest +pytest==5.2.2 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From b7976b9c3623adbac35904928522174035daaf12 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 25 Oct 2019 12:00:40 +0100 Subject: [PATCH 12/15] Update sentry-sdk from 0.13.0 to 0.13.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 a036e77ec..00c1a16ce 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==1.3.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.13.0 # https://github.com/getsentry/sentry-python +sentry-sdk==0.13.1 # https://github.com/getsentry/sentry-python {%- endif %} # Django From caa8b5a303a20065741193710455b5568f543029 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 26 Oct 2019 12:00:30 +0100 Subject: [PATCH 13/15] Update sphinx from 2.2.0 to 2.2.1 --- {{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 5dfff7ea1..bb60bed0c 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -2,7 +2,7 @@ Werkzeug==0.14.1 # pyup: < 0.15 # https://github.com/pallets/werkzeug ipdb==0.12.2 # https://github.com/gotcha/ipdb -Sphinx==2.2.0 # https://github.com/sphinx-doc/sphinx +Sphinx==2.2.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} From d006bc610c3d431d9544c4d5b27aa812cc2b93c5 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 28 Oct 2019 11:00:30 +0000 Subject: [PATCH 14/15] Update collectfast from 1.3.0 to 1.3.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 00c1a16ce..d65a0cbc2 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -5,7 +5,7 @@ gunicorn==19.9.0 # https://github.com/benoitc/gunicorn psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} -Collectfast==1.3.0 # https://github.com/antonagestam/collectfast +Collectfast==1.3.1 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} sentry-sdk==0.13.1 # https://github.com/getsentry/sentry-python From 9b61317682d402c1c232b3f9c486ffebd5a99339 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 28 Oct 2019 11:00:33 +0000 Subject: [PATCH 15/15] Update argon2-cffi from 19.1.0 to 19.2.0 --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index efff1c480..33ac3f7b5 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -4,7 +4,7 @@ Pillow==6.2.1 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin {%- endif %} -argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi +argon2-cffi==19.2.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==4.1.4 # https://github.com/evansd/whitenoise {%- endif %}