From 8a9b4eb58a97dae79b965a1ba2f3865dc16bbd98 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 24 Apr 2024 15:35:31 +0100 Subject: [PATCH 01/93] Update mypy from 1.7.1 to 1.10.0 --- {{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 12724a65d..601271c4f 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -13,7 +13,7 @@ watchfiles==0.21.0 # https://github.com/samuelcolvin/watchfiles # Testing # ------------------------------------------------------------------------------ -mypy==1.7.1 # https://github.com/python/mypy +mypy==1.10.0 # https://github.com/python/mypy django-stubs[compatible-mypy]==4.2.7 # https://github.com/typeddjango/django-stubs pytest==8.1.1 # https://github.com/pytest-dev/pytest pytest-sugar==1.0.0 # https://github.com/Frozenball/pytest-sugar From f0d2f40a2edd4dee61ddd4f62c7eb936ceded966 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 30 Apr 2024 12:42:58 +0100 Subject: [PATCH 02/93] Update django-stubs from 4.2.7 to 5.0.0 --- {{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 07c2aa158..ac1a04779 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -14,7 +14,7 @@ watchfiles==0.21.0 # https://github.com/samuelcolvin/watchfiles # Testing # ------------------------------------------------------------------------------ mypy==1.7.1 # https://github.com/python/mypy -django-stubs[compatible-mypy]==4.2.7 # https://github.com/typeddjango/django-stubs +django-stubs[compatible-mypy]==5.0.0 # https://github.com/typeddjango/django-stubs pytest==8.2.0 # https://github.com/pytest-dev/pytest pytest-sugar==1.0.0 # https://github.com/Frozenball/pytest-sugar {%- if cookiecutter.use_drf == "y" %} From 4c46f4b97e68c0759057a15a001325598b22c6af Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 30 Apr 2024 22:36:47 +0100 Subject: [PATCH 03/93] Update djangorestframework-stubs from 3.14.5 to 3.15.0 --- {{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 07c2aa158..5afd87944 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -18,7 +18,7 @@ django-stubs[compatible-mypy]==4.2.7 # https://github.com/typeddjango/django-st pytest==8.2.0 # https://github.com/pytest-dev/pytest pytest-sugar==1.0.0 # https://github.com/Frozenball/pytest-sugar {%- if cookiecutter.use_drf == "y" %} -djangorestframework-stubs[compatible-mypy]==3.14.5 # https://github.com/typeddjango/djangorestframework-stubs +djangorestframework-stubs[compatible-mypy]==3.15.0 # https://github.com/typeddjango/djangorestframework-stubs {%- endif %} # Documentation From 38318ab7f5e022b0d9e08d7c1776f3f786871724 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 5 May 2024 10:34:04 -0700 Subject: [PATCH 04/93] Update coverage from 7.5.0 to 7.5.1 (#5048) --- {{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 07c2aa158..0463a838d 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -29,7 +29,7 @@ sphinx-autobuild==2024.4.16 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ ruff==0.4.2 # https://github.com/astral-sh/ruff -coverage==7.5.0 # https://github.com/nedbat/coveragepy +coverage==7.5.1 # https://github.com/nedbat/coveragepy djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pre-commit==3.7.0 # https://github.com/pre-commit/pre-commit From 3608c21fe77afe329df8b4433c4520d60c0d03e9 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 5 May 2024 10:35:12 -0700 Subject: [PATCH 05/93] Update django-storages to 1.14.3 (#5047) --- {{cookiecutter.project_slug}}/requirements/production.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 3005aa2d1..6fe135c71 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -17,11 +17,11 @@ hiredis==2.3.2 # https://github.com/redis/hiredis-py # Django # ------------------------------------------------------------------------------ {%- if cookiecutter.cloud_provider == 'AWS' %} -django-storages[s3]==1.14.2 # https://github.com/jschneier/django-storages +django-storages[s3]==1.14.3 # https://github.com/jschneier/django-storages {%- elif cookiecutter.cloud_provider == 'GCP' %} -django-storages[google]==1.14.2 # https://github.com/jschneier/django-storages +django-storages[google]==1.14.3 # https://github.com/jschneier/django-storages {%- elif cookiecutter.cloud_provider == 'Azure' %} -django-storages[azure]==1.14.2 # https://github.com/jschneier/django-storages +django-storages[azure]==1.14.3 # https://github.com/jschneier/django-storages {%- endif %} {%- if cookiecutter.mail_service == 'Mailgun' %} django-anymail[mailgun]==10.3 # https://github.com/anymail/django-anymail From 7fa5d860201e3aefdad49f23fc4b395511e4725d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 5 May 2024 18:36:37 +0100 Subject: [PATCH 06/93] Auto-update pre-commit hooks (#5046) Co-authored-by: browniebroke <861044+browniebroke@users.noreply.github.com> --- {{cookiecutter.project_slug}}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 1d70003ae..71fee958b 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -35,7 +35,7 @@ repos: # Run the Ruff linter. - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.2 + rev: v0.4.3 hooks: # Linter - id: ruff From 8e9bd2273e89aa1b0e9df126fda64c00d3b85d49 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 6 May 2024 02:15:29 +0000 Subject: [PATCH 07/93] Release 2024.05.05 --- CHANGELOG.md | 11 +++++++++++ setup.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8927a37f7..5ad85cecd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.05.05 + + +### Updated + +- Auto-update pre-commit hooks ([#5046](https://github.com/cookiecutter/cookiecutter-django/pull/5046)) + +- Update django-storages to 1.14.3 ([#5047](https://github.com/cookiecutter/cookiecutter-django/pull/5047)) + +- Update coverage to 7.5.1 ([#5048](https://github.com/cookiecutter/cookiecutter-django/pull/5048)) + ## 2024.04.28 diff --git a/setup.py b/setup.py index 327d8f845..0dcf8df8e 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.04.28" +version = "2024.05.05" with open("README.md") as readme_file: long_description = readme_file.read() From 1b6a8e5ad08a07f02e1293ce14f6a5a2b1192ae0 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 6 May 2024 01:41:03 -0700 Subject: [PATCH 08/93] Update ruff to 0.4.3 (#5049) --- requirements.txt | 2 +- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index ac9aeea48..a623ffcb3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -ruff==0.4.2 +ruff==0.4.3 django-upgrade==1.16.0 djlint==1.34.1 pre-commit==3.7.0 diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 0463a838d..85af20bea 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -28,7 +28,7 @@ sphinx-autobuild==2024.4.16 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ -ruff==0.4.2 # https://github.com/astral-sh/ruff +ruff==0.4.3 # https://github.com/astral-sh/ruff coverage==7.5.1 # https://github.com/nedbat/coveragepy djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pre-commit==3.7.0 # https://github.com/pre-commit/pre-commit From a2129172d9d4fab0b6129676ca0a023d8a40876d Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 6 May 2024 01:43:15 -0700 Subject: [PATCH 09/93] Update jinja2 from 3.1.3 to 3.1.4 (#5051) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a623ffcb3..ee1a39967 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,5 +22,5 @@ pyyaml==6.0.1 # ------------------------------------------------------------------------------ PyGithub==2.3.0 gitpython==3.1.43 -jinja2==3.1.3 +jinja2==3.1.4 requests==2.31.0 From 340795cf4e511937c899890a0e54f3b3b1b6876e Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 6 May 2024 08:52:23 -0700 Subject: [PATCH 10/93] Update sentry-sdk to 2.1.1 (#5055) --- {{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 6fe135c71..02f9120ba 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg[c]==3.1.18 # https://github.com/psycopg/psycopg Collectfast==2.2.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==2.0.1 # https://github.com/getsentry/sentry-python +sentry-sdk==2.1.1 # https://github.com/getsentry/sentry-python {%- endif %} {%- if cookiecutter.use_docker == "n" and cookiecutter.windows == "y" %} hiredis==2.3.2 # https://github.com/redis/hiredis-py From 206e6b018f8d4f1ef4dad88a2a9ddd60a39fc4cd Mon Sep 17 00:00:00 2001 From: Areski Belaid Date: Mon, 6 May 2024 17:53:03 +0200 Subject: [PATCH 11/93] Fix nginx image name in production.yml (#5053) --- {{cookiecutter.project_slug}}/production.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/production.yml b/{{cookiecutter.project_slug}}/production.yml index f7bf5284f..29052cbac 100644 --- a/{{cookiecutter.project_slug}}/production.yml +++ b/{{cookiecutter.project_slug}}/production.yml @@ -102,7 +102,7 @@ services: build: context: . dockerfile: ./compose/production/nginx/Dockerfile - image: {{ cookiecutter.project_slug }}_local_nginx + image: {{ cookiecutter.project_slug }}_production_nginx depends_on: - django volumes: From ebf082b6968672da74c78406ed91c3964c03a634 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 6 May 2024 12:41:18 -0700 Subject: [PATCH 12/93] Update django from 4.2.11 to 4.2.12 (#5056) --- {{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 46ab19843..fddb4e1f5 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -28,7 +28,7 @@ uvicorn[standard]==0.29.0 # https://github.com/encode/uvicorn # Django # ------------------------------------------------------------------------------ -django==4.2.11 # pyup: < 5.0 # https://www.djangoproject.com/ +django==4.2.12 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.11.2 # https://github.com/joke2k/django-environ django-model-utils==4.5.0 # https://github.com/jazzband/django-model-utils django-allauth[mfa]==0.62.1 # https://github.com/pennersr/django-allauth From 26abd3a7a8d5056f18b622fed622b2017f77a40e Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 6 May 2024 16:32:56 -0700 Subject: [PATCH 13/93] Update django-model-utils from 4.5.0 to 4.5.1 (#5044) --- {{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 fddb4e1f5..a50afc603 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -30,7 +30,7 @@ uvicorn[standard]==0.29.0 # https://github.com/encode/uvicorn # ------------------------------------------------------------------------------ django==4.2.12 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.11.2 # https://github.com/joke2k/django-environ -django-model-utils==4.5.0 # https://github.com/jazzband/django-model-utils +django-model-utils==4.5.1 # https://github.com/jazzband/django-model-utils django-allauth[mfa]==0.62.1 # https://github.com/pennersr/django-allauth django-crispy-forms==2.1 # https://github.com/django-crispy-forms/django-crispy-forms crispy-bootstrap5==2024.2 # https://github.com/django-crispy-forms/crispy-bootstrap5 From 4fbd009965729656d8b55c619b810a0dbd3c13a5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 7 May 2024 02:17:15 +0000 Subject: [PATCH 14/93] Release 2024.05.06 --- CHANGELOG.md | 17 +++++++++++++++++ setup.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ad85cecd..2fda65d01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,23 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.05.06 + + +### Fixed + +- Fix nginx image name in production.yml ([#5053](https://github.com/cookiecutter/cookiecutter-django/pull/5053)) + +### Updated + +- Update django-model-utils to 4.5.1 ([#5044](https://github.com/cookiecutter/cookiecutter-django/pull/5044)) + +- Update django to 4.2.12 ([#5056](https://github.com/cookiecutter/cookiecutter-django/pull/5056)) + +- Update sentry-sdk to 2.1.1 ([#5055](https://github.com/cookiecutter/cookiecutter-django/pull/5055)) + +- Update ruff to 0.4.3 ([#5049](https://github.com/cookiecutter/cookiecutter-django/pull/5049)) + ## 2024.05.05 diff --git a/setup.py b/setup.py index 0dcf8df8e..77cac6782 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.05.05" +version = "2024.05.06" with open("README.md") as readme_file: long_description = readme_file.read() From 9b2947a353e470038ef9f72fab19c96c0969bbda Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 7 May 2024 16:34:12 -0700 Subject: [PATCH 15/93] Update django from 4.2.12 to 4.2.13 (#5058) --- {{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 a50afc603..1b10a113c 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -28,7 +28,7 @@ uvicorn[standard]==0.29.0 # https://github.com/encode/uvicorn # Django # ------------------------------------------------------------------------------ -django==4.2.12 # pyup: < 5.0 # https://www.djangoproject.com/ +django==4.2.13 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.11.2 # https://github.com/joke2k/django-environ django-model-utils==4.5.1 # https://github.com/jazzband/django-model-utils django-allauth[mfa]==0.62.1 # https://github.com/pennersr/django-allauth From f58530288caac620b42a32b19cb1b113b71ebefd Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 8 May 2024 02:06:10 +0000 Subject: [PATCH 16/93] Release 2024.05.07 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fda65d01..5cf557fe0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.05.07 + + +### Updated + +- Update django to 4.2.13 ([#5058](https://github.com/cookiecutter/cookiecutter-django/pull/5058)) + ## 2024.05.06 diff --git a/setup.py b/setup.py index 77cac6782..daa952a46 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.05.06" +version = "2024.05.07" with open("README.md") as readme_file: long_description = readme_file.read() From 2c55a3d443bec597ccc634324cb94bea9a2de9c5 Mon Sep 17 00:00:00 2001 From: Marios Frixou Date: Fri, 10 May 2024 11:04:10 +0300 Subject: [PATCH 17/93] Add Redis persistent storage when using celery --- {{cookiecutter.project_slug}}/local.yml | 5 +++++ {{cookiecutter.project_slug}}/production.yml | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/{{cookiecutter.project_slug}}/local.yml b/{{cookiecutter.project_slug}}/local.yml index cd2c7fad0..bbb02a326 100644 --- a/{{cookiecutter.project_slug}}/local.yml +++ b/{{cookiecutter.project_slug}}/local.yml @@ -3,6 +3,7 @@ version: '3' volumes: {{ cookiecutter.project_slug }}_local_postgres_data: {} {{ cookiecutter.project_slug }}_local_postgres_data_backups: {} + {% if cookiecutter.use_celery == 'y' %}{{ cookiecutter.project_slug }}_local_redis_data: {}{% endif %} services: django:{% if cookiecutter.use_celery == 'y' %} &django{% endif %} @@ -54,6 +55,10 @@ services: redis: image: docker.io/redis:6 container_name: {{ cookiecutter.project_slug }}_local_redis + {% if cookiecutter.use_celery == 'y' %} + volumes: + - {{ cookiecutter.project_slug }}_local_redis_data:/data + {% endif %} celeryworker: <<: *django diff --git a/{{cookiecutter.project_slug}}/production.yml b/{{cookiecutter.project_slug}}/production.yml index 29052cbac..b5bce66b2 100644 --- a/{{cookiecutter.project_slug}}/production.yml +++ b/{{cookiecutter.project_slug}}/production.yml @@ -7,6 +7,10 @@ volumes: {%- if cookiecutter.cloud_provider == 'None' %} production_django_media: {} {%- endif %} + {% if cookiecutter.use_celery == 'y' %} + production_redis_data: {} + {% endif %} + services: django:{% if cookiecutter.use_celery == 'y' %} &django{% endif %} @@ -68,6 +72,12 @@ services: redis: image: docker.io/redis:6 + {% if cookiecutter.use_celery == 'y' %} + volumes: + - production_redis_data:/data + {% endif %} + + {%- if cookiecutter.use_celery == 'y' %} celeryworker: From a45bb9eb2c0150a062d74baa30b16b469cfadce0 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 10 May 2024 01:05:27 -0700 Subject: [PATCH 18/93] Update ruff to 0.4.4 (#5061) * Update ruff from 0.4.3 to 0.4.4 * Update ruff from 0.4.3 to 0.4.4 --- requirements.txt | 2 +- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index ee1a39967..660fdca22 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -ruff==0.4.3 +ruff==0.4.4 django-upgrade==1.16.0 djlint==1.34.1 pre-commit==3.7.0 diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 85af20bea..2923caf33 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -28,7 +28,7 @@ sphinx-autobuild==2024.4.16 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ -ruff==0.4.3 # https://github.com/astral-sh/ruff +ruff==0.4.4 # https://github.com/astral-sh/ruff coverage==7.5.1 # https://github.com/nedbat/coveragepy djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pre-commit==3.7.0 # https://github.com/pre-commit/pre-commit From 9557d9ba0dacd554a5b8f06b26c2d24064f62a00 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 10 May 2024 09:05:39 +0100 Subject: [PATCH 19/93] Auto-update pre-commit hooks (#5062) Co-authored-by: browniebroke <861044+browniebroke@users.noreply.github.com> --- {{cookiecutter.project_slug}}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 71fee958b..104b31ca8 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -35,7 +35,7 @@ repos: # Run the Ruff linter. - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.3 + rev: v0.4.4 hooks: # Linter - id: ruff From ba7eb5a5d444f4f71ecc2c042a5c6f09e4871b17 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 10 May 2024 13:11:58 -0700 Subject: [PATCH 20/93] Update django-upgrade from 1.16.0 to 1.17.0 (#5065) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 660fdca22..0451b2c2a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ ruff==0.4.4 -django-upgrade==1.16.0 +django-upgrade==1.17.0 djlint==1.34.1 pre-commit==3.7.0 From fcc565b85e9038bc205af309b3eaf498b46587c9 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 10 May 2024 13:12:31 -0700 Subject: [PATCH 21/93] Update psycopg to 3.1.19 (#5064) * Update psycopg from 3.1.18 to 3.1.19 --- {{cookiecutter.project_slug}}/requirements/local.txt | 4 ++-- {{cookiecutter.project_slug}}/requirements/production.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 2923caf33..d3dc9af7b 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -3,9 +3,9 @@ Werkzeug[watchdog]==3.0.2 # https://github.com/pallets/werkzeug ipdb==0.13.13 # https://github.com/gotcha/ipdb {%- if cookiecutter.use_docker == 'y' %} -psycopg[c]==3.1.18 # https://github.com/psycopg/psycopg +psycopg[c]==3.1.19 # https://github.com/psycopg/psycopg {%- else %} -psycopg[binary]==3.1.18 # https://github.com/psycopg/psycopg +psycopg[binary]==3.1.19 # https://github.com/psycopg/psycopg {%- endif %} {%- if cookiecutter.use_async == 'y' or cookiecutter.use_celery == 'y' %} watchfiles==0.21.0 # https://github.com/samuelcolvin/watchfiles diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 02f9120ba..65f82e57a 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -3,7 +3,7 @@ -r base.txt gunicorn==22.0.0 # https://github.com/benoitc/gunicorn -psycopg[c]==3.1.18 # https://github.com/psycopg/psycopg +psycopg[c]==3.1.19 # https://github.com/psycopg/psycopg {%- if cookiecutter.use_whitenoise == 'n' %} Collectfast==2.2.0 # https://github.com/antonagestam/collectfast {%- endif %} From 3166ed72f17e27e8acaea0882ba6e4825b3f1981 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 11 May 2024 02:13:02 +0000 Subject: [PATCH 22/93] Release 2024.05.10 --- CHANGELOG.md | 13 +++++++++++++ setup.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cf557fe0..9b482446f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,19 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.05.10 + + +### Updated + +- Update psycopg to 3.1.19 ([#5064](https://github.com/cookiecutter/cookiecutter-django/pull/5064)) + +- Update django-upgrade to 1.17.0 ([#5065](https://github.com/cookiecutter/cookiecutter-django/pull/5065)) + +- Auto-update pre-commit hooks ([#5062](https://github.com/cookiecutter/cookiecutter-django/pull/5062)) + +- Update ruff to 0.4.4 ([#5061](https://github.com/cookiecutter/cookiecutter-django/pull/5061)) + ## 2024.05.07 diff --git a/setup.py b/setup.py index daa952a46..c147bbd99 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.05.07" +version = "2024.05.10" with open("README.md") as readme_file: long_description = readme_file.read() From b27efd4697e7d274a11ba893235dd2f159560129 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 11 May 2024 10:34:13 +0100 Subject: [PATCH 23/93] Auto-update pre-commit hooks (#5067) Co-authored-by: browniebroke <861044+browniebroke@users.noreply.github.com> --- {{cookiecutter.project_slug}}/.pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 104b31ca8..461dcf920 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: exclude: '{{cookiecutter.project_slug}}/templates/' - repo: https://github.com/adamchainz/django-upgrade - rev: '1.16.0' + rev: '1.17.0' hooks: - id: django-upgrade args: ['--target-version', '4.2'] From b3f1f8ef9382227cbcf5a6a1f0d64f5f18f6b637 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 11 May 2024 02:34:28 -0700 Subject: [PATCH 24/93] Update pre-commit to 3.7.1 (#5066) * Update pre-commit from 3.7.0 to 3.7.1 * Update pre-commit from 3.7.0 to 3.7.1 --- requirements.txt | 2 +- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0451b2c2a..47d06222f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,7 @@ binaryornot==0.4.4 ruff==0.4.4 django-upgrade==1.17.0 djlint==1.34.1 -pre-commit==3.7.0 +pre-commit==3.7.1 # Testing # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index d3dc9af7b..20b976b23 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -31,7 +31,7 @@ sphinx-autobuild==2024.4.16 # https://github.com/GaretJax/sphinx-autobuild ruff==0.4.4 # https://github.com/astral-sh/ruff coverage==7.5.1 # https://github.com/nedbat/coveragepy djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint -pre-commit==3.7.0 # https://github.com/pre-commit/pre-commit +pre-commit==3.7.1 # https://github.com/pre-commit/pre-commit # Django # ------------------------------------------------------------------------------ From 6f68602bbc56bd5a34441cc0c16f3cd78addb8b0 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 12 May 2024 02:16:53 +0000 Subject: [PATCH 25/93] Release 2024.05.11 --- CHANGELOG.md | 9 +++++++++ setup.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b482446f..b2856f307 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,15 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.05.11 + + +### Updated + +- Update pre-commit to 3.7.1 ([#5066](https://github.com/cookiecutter/cookiecutter-django/pull/5066)) + +- Auto-update pre-commit hooks ([#5067](https://github.com/cookiecutter/cookiecutter-django/pull/5067)) + ## 2024.05.10 diff --git a/setup.py b/setup.py index c147bbd99..6fac0c577 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.05.10" +version = "2024.05.11" with open("README.md") as readme_file: long_description = readme_file.read() From b60d26f6bd4ba1dc5782b2bcd8a7a22a4811a02c Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 13 May 2024 16:22:46 +0100 Subject: [PATCH 26/93] Rename workflow job --- .github/workflows/update-changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index 305a608df..635d26f23 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: jobs: - release: + update: # Disables this workflow from running in a repository that is not part of the indicated organization/user if: github.repository_owner == 'cookiecutter' From 10c85ce3d644ff7190b3d1bf1309386feee90b02 Mon Sep 17 00:00:00 2001 From: Matthew Foster Walsh <15671892+mfosterw@users.noreply.github.com> Date: Mon, 13 May 2024 13:18:56 -0400 Subject: [PATCH 27/93] Rename docker compose files to include 'docker-compose' (#4995) * Renamed local.yml to docker-compose.local.yml * Renamed production.yml to docker-compose.production.yml * Rename docs.yml to docker-compose.docs.yml * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bruno Alla --- docs/deployment-with-docker.rst | 28 +++++++------- docs/developing-locally-docker.rst | 38 +++++++++---------- docs/docker-postgres-backups.rst | 36 +++++++++--------- docs/document.rst | 2 +- docs/testing.rst | 6 +-- docs/troubleshooting.rst | 2 +- hooks/post_gen_project.py | 6 ++- tests/test_cookiecutter_generation.py | 14 +++++-- tests/test_docker.sh | 16 ++++---- .../.devcontainer/devcontainer.json | 2 +- {{cookiecutter.project_slug}}/.drone.yml | 10 ++--- .../.github/workflows/ci.yml | 10 ++--- {{cookiecutter.project_slug}}/.gitlab-ci.yml | 10 ++--- {{cookiecutter.project_slug}}/.travis.yml | 12 +++--- .../production/aws/maintenance/download | 2 +- .../compose/production/aws/maintenance/upload | 2 +- .../{docs.yml => docker-compose.docs.yml} | 0 .../{local.yml => docker-compose.local.yml} | 0 ...tion.yml => docker-compose.production.yml} | 0 {{cookiecutter.project_slug}}/docs/howto.rst | 2 +- .../docs/pycharm/configuration.rst | 2 +- .../locale/README.md | 4 +- 22 files changed, 107 insertions(+), 97 deletions(-) rename {{cookiecutter.project_slug}}/{docs.yml => docker-compose.docs.yml} (100%) rename {{cookiecutter.project_slug}}/{local.yml => docker-compose.local.yml} (100%) rename {{cookiecutter.project_slug}}/{production.yml => docker-compose.production.yml} (100%) diff --git a/docs/deployment-with-docker.rst b/docs/deployment-with-docker.rst index 3d2f9f813..ebc42a52d 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -14,7 +14,7 @@ Prerequisites Understanding the Docker Compose Setup -------------------------------------- -Before you begin, check out the ``production.yml`` file in the root of this project. Keep note of how it provides configuration for the following services: +Before you begin, check out the ``docker-compose.production.yml`` file in the root of this project. Keep note of how it provides configuration for the following services: * ``django``: your application running behind ``Gunicorn``; * ``postgres``: PostgreSQL database with the application's relational data; @@ -107,7 +107,7 @@ To solve this, you can either: 2. create a ``.env`` file in the root of the project with just variables you need. You'll need to also define them in ``.envs/.production/.django`` (hence duplicating them). 3. set these variables when running the build command:: - DJANGO_AWS_S3_CUSTOM_DOMAIN=example.com docker compose -f production.yml build``. + DJANGO_AWS_S3_CUSTOM_DOMAIN=example.com docker compose -f docker-compose.production.yml build``. None of these options are ideal, we're open to suggestions on how to improve this. If you think you have one, please open an issue or a pull request. @@ -122,42 +122,42 @@ Building & Running Production Stack You will need to build the stack first. To do that, run:: - docker compose -f production.yml build + docker compose -f docker-compose.production.yml build Once this is ready, you can run it with:: - docker compose -f production.yml up + docker compose -f docker-compose.production.yml up To run the stack and detach the containers, run:: - docker compose -f production.yml up -d + docker compose -f docker-compose.production.yml up -d To run a migration, open up a second terminal and run:: - docker compose -f production.yml run --rm django python manage.py migrate + docker compose -f docker-compose.production.yml run --rm django python manage.py migrate To create a superuser, run:: - docker compose -f production.yml run --rm django python manage.py createsuperuser + docker compose -f docker-compose.production.yml run --rm django python manage.py createsuperuser If you need a shell, run:: - docker compose -f production.yml run --rm django python manage.py shell + docker compose -f docker-compose.production.yml run --rm django python manage.py shell To check the logs out, run:: - docker compose -f production.yml logs + docker compose -f docker-compose.production.yml logs If you want to scale your application, run:: - docker compose -f production.yml up --scale django=4 - docker compose -f production.yml up --scale celeryworker=2 + docker compose -f docker-compose.production.yml up --scale django=4 + docker compose -f docker-compose.production.yml up --scale celeryworker=2 .. warning:: don't try to scale ``postgres``, ``celerybeat``, or ``traefik``. To see how your containers are doing run:: - docker compose -f production.yml ps + docker compose -f docker-compose.production.yml ps Example: Supervisor @@ -165,12 +165,12 @@ Example: Supervisor Once you are ready with your initial setup, you want to make sure that your application is run by a process manager to survive reboots and auto restarts in case of an error. You can use the process manager you are most familiar with. All -it needs to do is to run ``docker compose -f production.yml up`` in your projects root directory. +it needs to do is to run ``docker compose -f docker-compose.production.yml up`` in your projects root directory. If you are using ``supervisor``, you can use this file as a starting point:: [program:{{cookiecutter.project_slug}}] - command=docker compose -f production.yml up + command=docker compose -f docker-compose.production.yml up directory=/path/to/{{cookiecutter.project_slug}} redirect_stderr=true autostart=true diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 01970e469..83de99bb9 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -32,9 +32,9 @@ Build the Stack This can take a while, especially the first time you run this particular command on your development system:: - $ docker compose -f local.yml build + $ docker compose -f docker-compose.local.yml build -Generally, if you want to emulate production environment use ``production.yml`` instead. And this is true for any other actions you might need to perform: whenever a switch is required, just do it! +Generally, if you want to emulate production environment use ``docker-compose.production.yml`` instead. And this is true for any other actions you might need to perform: whenever a switch is required, just do it! Before doing any git commit, `pre-commit`_ should be installed globally on your local machine, and then:: @@ -51,11 +51,11 @@ This brings up both Django and PostgreSQL. The first time it is run it might tak Open a terminal at the project root and run the following for local development:: - $ docker compose -f local.yml up + $ docker compose -f docker-compose.local.yml up -You can also set the environment variable ``COMPOSE_FILE`` pointing to ``local.yml`` like this:: +You can also set the environment variable ``COMPOSE_FILE`` pointing to ``docker-compose.local.yml`` like this:: - $ export COMPOSE_FILE=local.yml + $ export COMPOSE_FILE=docker-compose.local.yml And then run:: @@ -67,21 +67,21 @@ To run in a detached (background) mode, just:: These commands don't run the docs service. In order to run docs service you can run:: - $ docker compose -f docs.yml up + $ docker compose -f docker-compose.docs.yml up To run the docs with local services just use:: - $ docker compose -f local.yml -f docs.yml up + $ docker compose -f docker-compose.local.yml -f docker-compose.docs.yml up The site should start and be accessible at http://localhost:3000 if you selected Webpack or Gulp as frontend pipeline and http://localhost:8000 otherwise. Execute Management Commands --------------------------- -As with any shell command that we wish to run in our container, this is done using the ``docker compose -f local.yml run --rm`` command: :: +As with any shell command that we wish to run in our container, this is done using the ``docker compose -f docker-compose.local.yml run --rm`` command: :: - $ docker compose -f local.yml run --rm django python manage.py migrate - $ docker compose -f local.yml run --rm django python manage.py createsuperuser + $ docker compose -f docker-compose.local.yml run --rm django python manage.py migrate + $ docker compose -f docker-compose.local.yml run --rm django python manage.py createsuperuser Here, ``django`` is the target service we are executing the commands against. Also, please note that the ``docker exec`` does not work for running management commands. @@ -97,7 +97,7 @@ When ``DEBUG`` is set to ``True``, the host is validated against ``['localhost', Configuring the Environment --------------------------- -This is the excerpt from your project's ``local.yml``: :: +This is the excerpt from your project's ``docker-compose.local.yml``: :: # ... @@ -163,8 +163,8 @@ You have to modify the relevant requirement file: base, local or production by a To get this change picked up, you'll need to rebuild the image(s) and restart the running container: :: - docker compose -f local.yml build - docker compose -f local.yml up + docker compose -f docker-compose.local.yml build + docker compose -f docker-compose.local.yml up Debugging ~~~~~~~~~ @@ -178,7 +178,7 @@ If you are using the following within your code to debug: :: Then you may need to run the following for it to work as desired: :: - $ docker compose -f local.yml run --rm --service-ports django + $ docker compose -f docker-compose.local.yml run --rm --service-ports django django-debug-toolbar @@ -231,7 +231,7 @@ Prerequisites: * ``use_docker`` was set to ``y`` on project initialization; * ``use_celery`` was set to ``y`` on project initialization. -By default, it's enabled both in local and production environments (``local.yml`` and ``production.yml`` Docker Compose configs, respectively) through a ``flower`` service. For added security, ``flower`` requires its clients to provide authentication credentials specified as the corresponding environments' ``.envs/.local/.django`` and ``.envs/.production/.django`` ``CELERY_FLOWER_USER`` and ``CELERY_FLOWER_PASSWORD`` environment variables. Check out ``localhost:5555`` and see for yourself. +By default, it's enabled both in local and production environments (``docker-compose.local.yml`` and ``docker-compose.production.yml`` Docker Compose configs, respectively) through a ``flower`` service. For added security, ``flower`` requires its clients to provide authentication credentials specified as the corresponding environments' ``.envs/.local/.django`` and ``.envs/.production/.django`` ``CELERY_FLOWER_USER`` and ``CELERY_FLOWER_PASSWORD`` environment variables. Check out ``localhost:5555`` and see for yourself. .. _`Flower`: https://github.com/mher/flower @@ -279,7 +279,7 @@ certs Take the certificates that you generated and place them in a folder called ``certs`` in the project's root folder. Assuming that you registered your local hostname as ``my-dev-env.local``, the certificates you will put in the folder should have the names ``my-dev-env.local.crt`` and ``my-dev-env.local.key``. -local.yml +docker-compose.local.yml ~~~~~~~~~ #. Add the ``nginx-proxy`` service. :: @@ -323,7 +323,7 @@ You should allow the new hostname. :: Rebuild your ``docker`` application. :: - $ docker compose -f local.yml up -d --build + $ docker compose -f docker-compose.local.yml up -d --build Go to your browser and type in your URL bar ``https://my-dev-env.local`` @@ -343,9 +343,9 @@ Webpack If you are using Webpack: -1. On the ``nginx-proxy`` service in ``local.yml``, change ``depends_on`` to ``node`` instead of ``django``. +1. On the ``nginx-proxy`` service in ``docker-compose.local.yml``, change ``depends_on`` to ``node`` instead of ``django``. -2. On the ``node`` service in ``local.yml``, add the following environment configuration: +2. On the ``node`` service in ``docker-compose.local.yml``, add the following environment configuration: :: diff --git a/docs/docker-postgres-backups.rst b/docs/docker-postgres-backups.rst index 302e4c4b8..d214ee4e8 100644 --- a/docs/docker-postgres-backups.rst +++ b/docs/docker-postgres-backups.rst @@ -1,14 +1,14 @@ PostgreSQL Backups with Docker ============================== -.. note:: For brevity it is assumed that you will be running the below commands against local environment, however, this is by no means mandatory so feel free to switch to ``production.yml`` when needed. +.. note:: For brevity it is assumed that you will be running the below commands against local environment, however, this is by no means mandatory so feel free to switch to ``docker-compose.production.yml`` when needed. Prerequisites ------------- #. the project was generated with ``use_docker`` set to ``y``; -#. the stack is up and running: ``docker compose -f local.yml up -d postgres``. +#. the stack is up and running: ``docker compose -f docker-compose.local.yml up -d postgres``. Creating a Backup @@ -16,7 +16,7 @@ Creating a Backup To create a backup, run:: - $ docker compose -f local.yml exec postgres backup + $ docker compose -f docker-compose.local.yml exec postgres backup Assuming your project's database is named ``my_project`` here is what you will see: :: @@ -31,7 +31,7 @@ Viewing the Existing Backups To list existing backups, :: - $ docker compose -f local.yml exec postgres backups + $ docker compose -f docker-compose.local.yml exec postgres backups These are the sample contents of ``/backups``: :: @@ -55,9 +55,9 @@ With a single backup file copied to ``.`` that would be :: $ docker cp 9c5c3f055843:/backups/backup_2018_03_13T09_05_07.sql.gz . -You can also get the container ID using ``docker compose -f local.yml ps -q postgres`` so if you want to automate your backups, you don't have to check the container ID manually every time. Here is the full command :: +You can also get the container ID using ``docker compose -f docker-compose.local.yml ps -q postgres`` so if you want to automate your backups, you don't have to check the container ID manually every time. Here is the full command :: - $ docker cp $(docker compose -f local.yml ps -q postgres):/backups ./backups + $ docker cp $(docker compose -f docker-compose.local.yml ps -q postgres):/backups ./backups .. _`command`: https://docs.docker.com/engine/reference/commandline/cp/ @@ -66,7 +66,7 @@ Restoring from the Existing Backup To restore from one of the backups you have already got (take the ``backup_2018_03_13T09_05_07.sql.gz`` for example), :: - $ docker compose -f local.yml exec postgres restore backup_2018_03_13T09_05_07.sql.gz + $ docker compose -f docker-compose.local.yml exec postgres restore backup_2018_03_13T09_05_07.sql.gz You will see something like :: @@ -95,15 +95,15 @@ Backup to Amazon S3 For uploading your backups to Amazon S3 you can use the aws cli container. There is an upload command for uploading the postgres /backups directory recursively and there is a download command for downloading a specific backup. The default S3 environment variables are used. :: - $ docker compose -f production.yml run --rm awscli upload - $ docker compose -f production.yml run --rm awscli download backup_2018_03_13T09_05_07.sql.gz + $ docker compose -f docker-compose.production.yml run --rm awscli upload + $ docker compose -f docker-compose.production.yml run --rm awscli download backup_2018_03_13T09_05_07.sql.gz Remove Backup ---------------------------------- To remove backup you can use the ``rmbackup`` command. This will remove the backup from the ``/backups`` directory. :: - $ docker compose -f local.yml exec postgres rmbackup backup_2018_03_13T09_05_07.sql.gz + $ docker compose -f docker-compose.local.yml exec postgres rmbackup backup_2018_03_13T09_05_07.sql.gz Upgrading PostgreSQL @@ -111,17 +111,17 @@ Upgrading PostgreSQL Upgrading PostgreSQL in your project requires a series of carefully executed steps. Start by halting all containers, excluding the postgres container. Following this, create a backup and proceed to remove the outdated data volume. :: - $ docker compose -f local.yml down - $ docker compose -f local.yml up -d postgres - $ docker compose -f local.yml run --rm postgres backup - $ docker compose -f local.yml down + $ docker compose -f docker-compose.local.yml down + $ docker compose -f docker-compose.local.yml up -d postgres + $ docker compose -f docker-compose.local.yml run --rm postgres backup + $ docker compose -f docker-compose.local.yml down $ docker volume rm my_project_postgres_data .. note:: Neglecting to remove the old data volume may lead to issues, such as the new postgres container failing to start with errors like ``FATAL: database files are incompatible with server``, and ``could not translate host name "postgres" to address: Name or service not known``. To complete the upgrade, update the PostgreSQL version in the corresponding Dockerfile (e.g. ``compose/production/postgres/Dockerfile``) and build a new version of PostgreSQL. :: - $ docker compose -f local.yml build postgres - $ docker compose -f local.yml up -d postgres - $ docker compose -f local.yml run --rm postgres restore backup_2018_03_13T09_05_07.sql.gz - $ docker compose -f local.yml up -d + $ docker compose -f docker-compose.local.yml build postgres + $ docker compose -f docker-compose.local.yml up -d postgres + $ docker compose -f docker-compose.local.yml run --rm postgres restore backup_2018_03_13T09_05_07.sql.gz + $ docker compose -f docker-compose.local.yml up -d diff --git a/docs/document.rst b/docs/document.rst index f93f2b60e..61cb692d3 100644 --- a/docs/document.rst +++ b/docs/document.rst @@ -11,7 +11,7 @@ After you have set up to `develop locally`_, run the following command from the If you set up your project to `develop locally with docker`_, run the following command: :: - $ docker compose -f docs.yml up + $ docker compose -f docker-compose.docs.yml up Navigate to port 9000 on your host to see the documentation. This will be opened automatically at `localhost`_ for local, non-docker development. diff --git a/docs/testing.rst b/docs/testing.rst index d403a30eb..58a05770a 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -19,7 +19,7 @@ You will get a readout of the `users` app that has already been set up with test If you set up your project to `develop locally with docker`_, run the following command: :: - $ docker compose -f local.yml run --rm django pytest + $ docker compose -f docker-compose.local.yml run --rm django pytest Targeting particular apps for testing in ``docker`` follows a similar pattern as previously shown above. @@ -36,8 +36,8 @@ Once the tests are complete, in order to see the code coverage, run the followin If you're running the project locally with Docker, use these commands instead: :: - $ docker compose -f local.yml run --rm django coverage run -m pytest - $ docker compose -f local.yml run --rm django coverage report + $ docker compose -f docker-compose.local.yml run --rm django coverage run -m pytest + $ docker compose -f docker-compose.local.yml run --rm django coverage report .. note:: diff --git a/docs/troubleshooting.rst b/docs/troubleshooting.rst index 80bab2e29..847f0a701 100644 --- a/docs/troubleshooting.rst +++ b/docs/troubleshooting.rst @@ -30,7 +30,7 @@ If you recreate the project multiple times with the same name, Docker would pres To fix this, you can either: -- Clear your project-related Docker cache with ``docker compose -f local.yml down --volumes --rmi all``. +- Clear your project-related Docker cache with ``docker compose -f docker-compose.local.yml down --volumes --rmi all``. - Use the Docker volume sub-commands to find volumes (`ls`_) and remove them (`rm`_). - Use the `prune`_ command to clear system-wide (use with care!). diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 1ddab0636..9e9af5f2d 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -78,7 +78,11 @@ def remove_docker_files(): shutil.rmtree(".devcontainer") shutil.rmtree("compose") - file_names = ["local.yml", "production.yml", ".dockerignore"] + file_names = [ + "docker-compose.local.yml", + "docker-compose.production.yml", + ".dockerignore", + ] for file_name in file_names: os.remove(file_name) if "{{ cookiecutter.editor }}" == "PyCharm": diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index 6b581b03a..141ae4cc1 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -247,7 +247,13 @@ def test_djlint_lint_passes(cookies, context_override): # TODO: remove T002 when fixed https://github.com/Riverside-Healthcare/djLint/issues/687 ignored_rules = "H006,H030,H031,T002" try: - sh.djlint("--lint", "--ignore", f"{autofixable_rules},{ignored_rules}", ".", _cwd=str(result.project_path)) + sh.djlint( + "--lint", + "--ignore", + f"{autofixable_rules},{ignored_rules}", + ".", + _cwd=str(result.project_path), + ) except sh.ErrorReturnCode as e: pytest.fail(e.stdout.decode()) @@ -268,7 +274,7 @@ def test_djlint_check_passes(cookies, context_override): ["use_docker", "expected_test_script"], [ ("n", "pytest"), - ("y", "docker compose -f local.yml run django pytest"), + ("y", "docker compose -f docker-compose.local.yml run django pytest"), ], ) def test_travis_invokes_pytest(cookies, context, use_docker, expected_test_script): @@ -293,7 +299,7 @@ def test_travis_invokes_pytest(cookies, context, use_docker, expected_test_scrip ["use_docker", "expected_test_script"], [ ("n", "pytest"), - ("y", "docker compose -f local.yml run django pytest"), + ("y", "docker compose -f docker-compose.local.yml run django pytest"), ], ) def test_gitlab_invokes_precommit_and_pytest(cookies, context, use_docker, expected_test_script): @@ -320,7 +326,7 @@ def test_gitlab_invokes_precommit_and_pytest(cookies, context, use_docker, expec ["use_docker", "expected_test_script"], [ ("n", "pytest"), - ("y", "docker compose -f local.yml run django pytest"), + ("y", "docker compose -f docker-compose.local.yml run django pytest"), ], ) def test_github_invokes_linter_and_pytest(cookies, context, use_docker, expected_test_script): diff --git a/tests/test_docker.sh b/tests/test_docker.sh index 96bf8662d..473eede04 100755 --- a/tests/test_docker.sh +++ b/tests/test_docker.sh @@ -15,22 +15,22 @@ cookiecutter ../../ --no-input --overwrite-if-exists use_docker=y "$@" cd my_awesome_project # make sure all images build -docker compose -f local.yml build +docker compose -f docker-compose.local.yml build # run the project's type checks -docker compose -f local.yml run django mypy my_awesome_project +docker compose -f docker-compose.local.yml run django mypy my_awesome_project # run the project's tests -docker compose -f local.yml run django pytest +docker compose -f docker-compose.local.yml run django pytest # return non-zero status code if there are migrations that have not been created -docker compose -f local.yml run django python manage.py makemigrations --dry-run --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; } +docker compose -f docker-compose.local.yml run django python manage.py makemigrations --dry-run --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; } # Test support for translations -docker compose -f local.yml run django python manage.py makemessages --all +docker compose -f docker-compose.local.yml run django python manage.py makemessages --all # Make sure the check doesn't raise any warnings -docker compose -f local.yml run \ +docker compose -f docker-compose.local.yml run \ -e DJANGO_SECRET_KEY="$(openssl rand -base64 64)" \ -e REDIS_URL=redis://redis:6379/0 \ -e CELERY_BROKER_URL=redis://redis:6379/0 \ @@ -43,10 +43,10 @@ docker compose -f local.yml run \ django python manage.py check --settings=config.settings.production --deploy --database default --fail-level WARNING # Generate the HTML for the documentation -docker compose -f docs.yml run docs make html +docker compose -f docker-compose.docs.yml run docs make html # Run npm build script if package.json is present if [ -f "package.json" ] then - docker compose -f local.yml run node npm run build + docker compose -f docker-compose.local.yml run node npm run build fi diff --git a/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json b/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json index e16d06a20..5604b8a85 100644 --- a/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json +++ b/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ { "name": "{{cookiecutter.project_slug}}_dev", "dockerComposeFile": [ - "../local.yml" + "../docker-compose.local.yml" ], "init": true, "mounts": [ diff --git a/{{cookiecutter.project_slug}}/.drone.yml b/{{cookiecutter.project_slug}}/.drone.yml index 829ead2ca..d6c13e62b 100644 --- a/{{cookiecutter.project_slug}}/.drone.yml +++ b/{{cookiecutter.project_slug}}/.drone.yml @@ -31,11 +31,11 @@ steps: environment: DATABASE_URL: pgsql://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres/$POSTGRES_DB commands: - - docker-compose -f local.yml build - - docker-compose -f docs.yml build - - docker-compose -f local.yml run --rm django python manage.py migrate - - docker-compose -f local.yml up -d - - docker-compose -f local.yml run django pytest + - docker-compose -f docker-compose.local.yml build + - docker-compose -f docker-compose.docs.yml build + - docker-compose -f docker-compose.local.yml run --rm django python manage.py migrate + - docker-compose -f docker-compose.local.yml up -d + - docker-compose -f docker-compose.local.yml run django pytest {%- else %} image: python:3.12 commands: diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index 4e6ec1cd2..5cb9ead4f 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -69,19 +69,19 @@ jobs: {%- if cookiecutter.use_docker == 'y' %} - name: Build the Stack - run: docker compose -f local.yml build django + run: docker compose -f docker-compose.local.yml build django - name: Build the docs - run: docker compose -f docs.yml build docs + run: docker compose -f docker-compose.docs.yml build docs - name: Run DB Migrations - run: docker compose -f local.yml run --rm django python manage.py migrate + run: docker compose -f docker-compose.local.yml run --rm django python manage.py migrate - name: Run Django Tests - run: docker compose -f local.yml run django pytest + run: docker compose -f docker-compose.local.yml run django pytest - name: Tear down the Stack - run: docker compose -f local.yml down + run: docker compose -f docker-compose.local.yml down {%- else %} - name: Set up Python diff --git a/{{cookiecutter.project_slug}}/.gitlab-ci.yml b/{{cookiecutter.project_slug}}/.gitlab-ci.yml index 75c03e876..41eea0db4 100644 --- a/{{cookiecutter.project_slug}}/.gitlab-ci.yml +++ b/{{cookiecutter.project_slug}}/.gitlab-ci.yml @@ -33,13 +33,13 @@ pytest: services: - docker:dind before_script: - - docker compose -f local.yml build - - docker compose -f docs.yml build + - docker compose -f docker-compose.local.yml build + - docker compose -f docker-compose.docs.yml build # Ensure celerybeat does not crash due to non-existent tables - - docker compose -f local.yml run --rm django python manage.py migrate - - docker compose -f local.yml up -d + - docker compose -f docker-compose.local.yml run --rm django python manage.py migrate + - docker compose -f docker-compose.local.yml up -d script: - - docker compose -f local.yml run django pytest + - docker compose -f docker-compose.local.yml run django pytest {%- else %} image: python:3.12 tags: diff --git a/{{cookiecutter.project_slug}}/.travis.yml b/{{cookiecutter.project_slug}}/.travis.yml index abf12f42e..97f9f60a2 100644 --- a/{{cookiecutter.project_slug}}/.travis.yml +++ b/{{cookiecutter.project_slug}}/.travis.yml @@ -19,15 +19,15 @@ jobs: before_script: - docker compose -v - docker -v - - docker compose -f local.yml build - - docker compose -f docs.yml build + - docker compose -f docker-compose.local.yml build + - docker compose -f docker-compose.docs.yml build # Ensure celerybeat does not crash due to non-existent tables - - docker compose -f local.yml run --rm django python manage.py migrate - - docker compose -f local.yml up -d + - docker compose -f docker-compose.local.yml run --rm django python manage.py migrate + - docker compose -f docker-compose.local.yml up -d script: - - docker compose -f local.yml run django pytest + - docker compose -f docker-compose.local.yml run django pytest after_failure: - - docker compose -f local.yml logs + - docker compose -f docker-compose.local.yml logs {%- else %} before_install: - sudo apt-get update -qq diff --git a/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/download b/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/download index 9561d917a..12871a773 100644 --- a/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/download +++ b/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/download @@ -3,7 +3,7 @@ ### Download a file from your Amazon S3 bucket to the postgres /backups folder ### ### Usage: -### $ docker compose -f production.yml run --rm awscli <1> +### $ docker compose -f docker-compose.production.yml run --rm awscli <1> set -o errexit set -o pipefail diff --git a/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/upload b/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/upload index 73c1b9bec..2f577824e 100644 --- a/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/upload +++ b/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/upload @@ -3,7 +3,7 @@ ### Upload the /backups folder to Amazon S3 ### ### Usage: -### $ docker compose -f production.yml run --rm awscli upload +### $ docker compose -f docker-compose.production.yml run --rm awscli upload set -o errexit set -o pipefail diff --git a/{{cookiecutter.project_slug}}/docs.yml b/{{cookiecutter.project_slug}}/docker-compose.docs.yml similarity index 100% rename from {{cookiecutter.project_slug}}/docs.yml rename to {{cookiecutter.project_slug}}/docker-compose.docs.yml diff --git a/{{cookiecutter.project_slug}}/local.yml b/{{cookiecutter.project_slug}}/docker-compose.local.yml similarity index 100% rename from {{cookiecutter.project_slug}}/local.yml rename to {{cookiecutter.project_slug}}/docker-compose.local.yml diff --git a/{{cookiecutter.project_slug}}/production.yml b/{{cookiecutter.project_slug}}/docker-compose.production.yml similarity index 100% rename from {{cookiecutter.project_slug}}/production.yml rename to {{cookiecutter.project_slug}}/docker-compose.production.yml diff --git a/{{cookiecutter.project_slug}}/docs/howto.rst b/{{cookiecutter.project_slug}}/docs/howto.rst index 2d734ceb2..944c2b731 100644 --- a/{{cookiecutter.project_slug}}/docs/howto.rst +++ b/{{cookiecutter.project_slug}}/docs/howto.rst @@ -15,7 +15,7 @@ from inside the `{{cookiecutter.project_slug}}/docs` directory. {% else %} To build and serve docs, use the commands:: - docker compose -f local.yml up docs + docker compose -f docker-compose.local.yml up docs {% endif %} diff --git a/{{cookiecutter.project_slug}}/docs/pycharm/configuration.rst b/{{cookiecutter.project_slug}}/docs/pycharm/configuration.rst index d8e769167..148854c64 100644 --- a/{{cookiecutter.project_slug}}/docs/pycharm/configuration.rst +++ b/{{cookiecutter.project_slug}}/docs/pycharm/configuration.rst @@ -21,7 +21,7 @@ Next, you have to add new remote python interpreter, based on already tested dep .. image:: images/3.png -Switch to *Docker Compose* and select `local.yml` file from directory of your project, next set *Service name* to `django` +Switch to *Docker Compose* and select `docker-compose.local.yml` file from directory of your project, next set *Service name* to `django` .. image:: images/4.png diff --git a/{{cookiecutter.project_slug}}/locale/README.md b/{{cookiecutter.project_slug}}/locale/README.md index a514ad10c..8971441a0 100644 --- a/{{cookiecutter.project_slug}}/locale/README.md +++ b/{{cookiecutter.project_slug}}/locale/README.md @@ -3,7 +3,7 @@ Start by configuring the `LANGUAGES` settings in `base.py`, by uncommenting languages you are willing to support. Then, translations strings will be placed in this folder when running: ```bash -{% if cookiecutter.use_docker == 'y' %}docker compose -f local.yml run --rm django {% endif %}python manage.py makemessages -all --no-location +{% if cookiecutter.use_docker == 'y' %}docker compose -f docker-compose.local.yml run --rm django {% endif %}python manage.py makemessages -all --no-location ``` This should generate `django.po` (stands for Portable Object) files under each locale `/LC_MESSAGES/django.po`. Each translatable string in the codebase is collected with its `msgid` and need to be translated as `msgstr`, for example: @@ -16,7 +16,7 @@ msgstr "utilisateurs" Once all translations are done, they need to be compiled into `.mo` files (stands for Machine Object), which are the actual binary files used by the application: ```bash -{% if cookiecutter.use_docker == 'y' %}docker compose -f local.yml run --rm django {% endif %}python manage.py compilemessages +{% if cookiecutter.use_docker == 'y' %}docker compose -f docker-compose.local.yml run --rm django {% endif %}python manage.py compilemessages ``` Note that the `.po` files are NOT used by the application directly, so if the `.mo` files are out of dates, the content won't appear as translated even if the `.po` files are up-to-date. From 9322f16b1af697ab996057d969d85a3ced2f75bc Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 13 May 2024 17:27:03 +0000 Subject: [PATCH 28/93] Update Contributors --- .github/contributors.json | 5 +++++ CONTRIBUTORS.md | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/.github/contributors.json b/.github/contributors.json index 40a7d26d6..b74dc4d15 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1563,5 +1563,10 @@ "name": "quroom", "github_login": "quroom", "twitter_username": "" + }, + { + "name": "Marios Frixou", + "github_login": "frixou89", + "twitter_username": "" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index bf4896dc8..595e9924a 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1405,6 +1405,13 @@ Listed in alphabetical order. marciomazza + + Marios Frixou + + frixou89 + + + Martin Blech From bebffe7cc9358ec921723ea7b44e111bf736e69d Mon Sep 17 00:00:00 2001 From: mpsantos Date: Mon, 13 May 2024 14:27:41 -0300 Subject: [PATCH 29/93] Remove obsolete `version` element from docker compose files (#5059) Co-authored-by: Bruno Alla --- {{cookiecutter.project_slug}}/docker-compose.docs.yml | 2 -- {{cookiecutter.project_slug}}/docker-compose.local.yml | 2 -- {{cookiecutter.project_slug}}/docker-compose.production.yml | 2 -- 3 files changed, 6 deletions(-) diff --git a/{{cookiecutter.project_slug}}/docker-compose.docs.yml b/{{cookiecutter.project_slug}}/docker-compose.docs.yml index d9e50b928..215b6c3b7 100644 --- a/{{cookiecutter.project_slug}}/docker-compose.docs.yml +++ b/{{cookiecutter.project_slug}}/docker-compose.docs.yml @@ -1,5 +1,3 @@ -version: '3' - services: docs: image: {{ cookiecutter.project_slug }}_local_docs diff --git a/{{cookiecutter.project_slug}}/docker-compose.local.yml b/{{cookiecutter.project_slug}}/docker-compose.local.yml index bbb02a326..eced08ee8 100644 --- a/{{cookiecutter.project_slug}}/docker-compose.local.yml +++ b/{{cookiecutter.project_slug}}/docker-compose.local.yml @@ -1,5 +1,3 @@ -version: '3' - volumes: {{ cookiecutter.project_slug }}_local_postgres_data: {} {{ cookiecutter.project_slug }}_local_postgres_data_backups: {} diff --git a/{{cookiecutter.project_slug}}/docker-compose.production.yml b/{{cookiecutter.project_slug}}/docker-compose.production.yml index b5bce66b2..d0d06338d 100644 --- a/{{cookiecutter.project_slug}}/docker-compose.production.yml +++ b/{{cookiecutter.project_slug}}/docker-compose.production.yml @@ -1,5 +1,3 @@ -version: '3' - volumes: production_postgres_data: {} production_postgres_data_backups: {} From f82807f53ac76ab80010bb22874eb3a0ce8736a6 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 13 May 2024 11:10:59 -0700 Subject: [PATCH 30/93] Update werkzeug to 3.0.3 (#5050) --- {{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 20b976b23..23253a9da 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,6 +1,6 @@ -r production.txt -Werkzeug[watchdog]==3.0.2 # https://github.com/pallets/werkzeug +Werkzeug[watchdog]==3.0.3 # https://github.com/pallets/werkzeug ipdb==0.13.13 # https://github.com/gotcha/ipdb {%- if cookiecutter.use_docker == 'y' %} psycopg[c]==3.1.19 # https://github.com/psycopg/psycopg From 9fd3154127e84165163bc1c99c588bdc3d5ddc8a Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 13 May 2024 19:53:55 +0100 Subject: [PATCH 31/93] Ignore type errors from mypy --- .../{{cookiecutter.project_slug}}/users/forms.py | 4 ++-- .../{{cookiecutter.project_slug}}/users/tests/test_admin.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py index 830fca60d..35a70101e 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py @@ -10,7 +10,7 @@ from .models import User class UserAdminChangeForm(admin_forms.UserChangeForm): - class Meta(admin_forms.UserChangeForm.Meta): + class Meta(admin_forms.UserChangeForm.Meta): # type: ignore[name-defined] model = User {%- if cookiecutter.username_type == "email" %} field_classes = {"email": EmailField} @@ -23,7 +23,7 @@ class UserAdminCreationForm(admin_forms.UserCreationForm): To change user signup, see UserSignupForm and UserSocialSignupForm. """ - class Meta(admin_forms.UserCreationForm.Meta): + class Meta(admin_forms.UserCreationForm.Meta): # type: ignore[name-defined] model = User {%- if cookiecutter.username_type == "email" %} fields = ("email",) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py index f802b8ba1..66555c4ea 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py @@ -62,7 +62,7 @@ class TestUserAdmin: # Reload the admin module to apply the setting change import {{ cookiecutter.project_slug }}.users.admin as users_admin - with contextlib.suppress(admin.sites.AlreadyRegistered): + with contextlib.suppress(admin.sites.AlreadyRegistered): # type: ignore[attr-defined] reload(users_admin) @pytest.mark.django_db() From 88a9a15dbf6af69d4f0700c8acc773376fc48bc9 Mon Sep 17 00:00:00 2001 From: Jens Kaeske <39417308+jkaeske@users.noreply.github.com> Date: Mon, 13 May 2024 22:45:55 +0200 Subject: [PATCH 32/93] Fix handling of staticfile settings if cloud provider and whitenoise are selected (#5057) Co-authored-by: Bruno Alla --- .../config/settings/production.py | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 0cebe1d96..72f92cc23 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -118,7 +118,7 @@ AZURE_CONTAINER = env("DJANGO_AZURE_CONTAINER_NAME") # STATIC & MEDIA # ------------------------ STORAGES = { -{%- if cookiecutter.use_whitenoise == 'y' %} +{%- if cookiecutter.use_whitenoise == 'y' and cookiecutter.cloud_provider == 'None' %} "default": { "BACKEND": "django.core.files.storage.FileSystemStorage", }, @@ -133,6 +133,11 @@ STORAGES = { "file_overwrite": False, }, }, + {%- if cookiecutter.use_whitenoise == 'y' %} + "staticfiles": { + "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage", + }, + {%- else %} "staticfiles": { "BACKEND": "storages.backends.s3.S3Storage", "OPTIONS": { @@ -140,6 +145,7 @@ STORAGES = { "default_acl": "public-read", }, }, + {%- endif %} {%- elif cookiecutter.cloud_provider == 'GCP' %} "default": { "BACKEND": "storages.backends.gcloud.GoogleCloudStorage", @@ -148,6 +154,11 @@ STORAGES = { "file_overwrite": False, }, }, + {%- if cookiecutter.use_whitenoise == 'y' %} + "staticfiles": { + "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage", + }, + {%- else %} "staticfiles": { "BACKEND": "storages.backends.gcloud.GoogleCloudStorage", "OPTIONS": { @@ -155,6 +166,7 @@ STORAGES = { "default_acl": "publicRead", }, }, + {%- endif %} {%- elif cookiecutter.cloud_provider == 'Azure' %} "default": { "BACKEND": "storages.backends.azure_storage.AzureStorage", @@ -163,28 +175,40 @@ STORAGES = { "file_overwrite": False, }, }, + {%- if cookiecutter.use_whitenoise == 'y' %} + "staticfiles": { + "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage", + }, + {%- else %} "staticfiles": { "BACKEND": "storages.backends.azure_storage.AzureStorage", "OPTIONS": { "location": "static", }, }, + {%- endif %} {%- endif %} } {%- endif %} {%- if cookiecutter.cloud_provider == 'AWS' %} MEDIA_URL = f"https://{aws_s3_domain}/media/" +{%- if cookiecutter.use_whitenoise == 'n' %} COLLECTFAST_STRATEGY = "collectfast.strategies.boto3.Boto3Strategy" STATIC_URL = f"https://{aws_s3_domain}/static/" +{%- endif %} {%- elif cookiecutter.cloud_provider == 'GCP' %} MEDIA_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/media/" +{%- if cookiecutter.use_whitenoise == 'n' %} COLLECTFAST_STRATEGY = "collectfast.strategies.gcloud.GoogleCloudStrategy" STATIC_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/static/" +{%- endif %} {%- elif cookiecutter.cloud_provider == 'Azure' %} MEDIA_URL = f"https://{AZURE_ACCOUNT_NAME}.blob.core.windows.net/media/" +{%- if cookiecutter.use_whitenoise == 'n' %} STATIC_URL = f"https://{AZURE_ACCOUNT_NAME}.blob.core.windows.net/static/" {%- endif %} +{%- endif %} # EMAIL # ------------------------------------------------------------------------------ From e9f029decf29128ba80ee2d37d12a96aaaf11ae2 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 13 May 2024 22:26:26 +0100 Subject: [PATCH 33/93] Add noqa to ignore ruff false positive (#5068) --- {{cookiecutter.project_slug}}/config/settings/production.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 72f92cc23..2f5f0be83 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -309,7 +309,8 @@ COMPRESS_STORAGE = "compressor.storage.GzipCompressorFileStorage" COMPRESS_STORAGE = STORAGES["staticfiles"]["BACKEND"] {%- endif %} # https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_URL -COMPRESS_URL = STATIC_URL{% if cookiecutter.use_whitenoise == 'y' or cookiecutter.cloud_provider == 'None' %}{% endif %} +COMPRESS_URL = STATIC_URL{% if cookiecutter.use_whitenoise == 'y' or cookiecutter.cloud_provider == 'None' %} # noqa: F405 +{%- endif -%} {%- if cookiecutter.use_whitenoise == 'y' %} # https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_OFFLINE COMPRESS_OFFLINE = True # Offline compression is required when using Whitenoise From beba4c177d6c0c40e51ec71fa4447966c10a4297 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 14 May 2024 02:14:34 +0000 Subject: [PATCH 34/93] Release 2024.05.13 --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ setup.py | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2856f307..bf8429442 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,33 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.05.13 + + +### Changed + +- Rename docker compose files to include 'docker-compose' ([#4995](https://github.com/cookiecutter/cookiecutter-django/pull/4995)) + +- Remove obsolete `version` element from docker compose files ([#5059](https://github.com/cookiecutter/cookiecutter-django/pull/5059)) + +- Add Redis persistent storage when using celery ([#5063](https://github.com/cookiecutter/cookiecutter-django/pull/5063)) + +### Fixed + +- Add noqa to ignore ruff false positive ([#5068](https://github.com/cookiecutter/cookiecutter-django/pull/5068)) + +- Fix staticfile settings with cloud provider and whitenoise ([#5057](https://github.com/cookiecutter/cookiecutter-django/pull/5057)) + +### Updated + +- Update djangorestframework-stubs to 3.15.0 ([#5041](https://github.com/cookiecutter/cookiecutter-django/pull/5041)) + +- Update django-stubs to 5.0.0 ([#5040](https://github.com/cookiecutter/cookiecutter-django/pull/5040)) + +- Update mypy to 1.10.0 ([#5022](https://github.com/cookiecutter/cookiecutter-django/pull/5022)) + +- Update werkzeug to 3.0.3 ([#5050](https://github.com/cookiecutter/cookiecutter-django/pull/5050)) + ## 2024.05.11 diff --git a/setup.py b/setup.py index 6fac0c577..c1921f987 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.05.11" +version = "2024.05.13" with open("README.md") as readme_file: long_description = readme_file.read() From 1732734ce5302a184a075cfb4ed114330c942b8b Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 15 May 2024 16:39:14 +0100 Subject: [PATCH 35/93] Disable DDT profiling panel (#5069) It's currently not working well under Python 3.12 --- {{cookiecutter.project_slug}}/config/settings/local.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py index ab526f968..f63151239 100644 --- a/{{cookiecutter.project_slug}}/config/settings/local.py +++ b/{{cookiecutter.project_slug}}/config/settings/local.py @@ -64,7 +64,12 @@ INSTALLED_APPS += ["debug_toolbar"] MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"] # https://django-debug-toolbar.readthedocs.io/en/latest/configuration.html#debug-toolbar-config DEBUG_TOOLBAR_CONFIG = { - "DISABLE_PANELS": ["debug_toolbar.panels.redirects.RedirectsPanel"], + "DISABLE_PANELS": [ + "debug_toolbar.panels.redirects.RedirectsPanel", + # Disable profiling panel due to an issue with Python 3.12: + # https://github.com/jazzband/django-debug-toolbar/issues/1875 + "debug_toolbar.panels.profiling.ProfilingPanel", + ], "SHOW_TEMPLATE_CONTEXT": True, } # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips From 9eec5fc2277b0cd474f2c3627f80aac8336e7e06 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 16 May 2024 02:15:36 +0000 Subject: [PATCH 36/93] Release 2024.05.15 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf8429442..9f59eb5a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.05.15 + + +### Fixed + +- Disable DDT profiling panel ([#5069](https://github.com/cookiecutter/cookiecutter-django/pull/5069)) + ## 2024.05.13 diff --git a/setup.py b/setup.py index c1921f987..27c7cd671 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.05.13" +version = "2024.05.15" with open("README.md") as readme_file: long_description = readme_file.read() From 0bf7e51c1b7c60f093f59c07e7368edb97eee3ae Mon Sep 17 00:00:00 2001 From: Geo Maciolek Date: Thu, 16 May 2024 03:58:13 -0400 Subject: [PATCH 37/93] Update Two scoops of Django book link & image (#5073) The book link for "Two Scoops of Django 3.x" was a 404; updated to the current page in `README` and `faq.rst`. `README.md`: pointed to a current cover image. Changed the HTML `` tags to use markdown instead, removed `

` center tags --- README.md | 10 +++------- docs/faq.rst | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c38eec277..6263c599a 100644 --- a/README.md +++ b/README.md @@ -65,19 +65,15 @@ This project is an open source project run by volunteers. You can sponsor us via Projects that provide financial support to the maintainers: ---- +### Two Scoops of Django -

- -

+[![Cover of the book "Two Scoops of Django 3.x"](https://www.feldroy.com/static/book-TSD3-800.jpg)](https://www.feldroy.com/two-scoops-press#two-scoops-of-django) Two Scoops of Django 3.x is the best ice cream-themed Django reference in the universe! ### PyUp -

- -

+[![PyUp Logo](https://pyup.io/static/images/logo.png)](https://pyup.io) PyUp brings you automated security and dependency updates used by Google and other organizations. Free for open source projects! diff --git a/docs/faq.rst b/docs/faq.rst index 9f0b52a7d..294e6c8e1 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -24,4 +24,4 @@ Why doesn't this follow the layout from Two Scoops of Django? You may notice that some elements of this project do not exactly match what we describe in chapter 3 of `Two Scoops of Django 3.x`_. The reason for that is this project, amongst other things, serves as a test bed for trying out new ideas and concepts. Sometimes they work, sometimes they don't, but the end result is that it won't necessarily match precisely what is described in the book I co-authored. -.. _Two Scoops of Django 3.x: https://www.feldroy.com/books/two-scoops-of-django-3-x +.. _Two Scoops of Django 3.x: https://www.feldroy.com/two-scoops-press#two-scoops-of-django From e5fef8195811bb36d552d57bd500905eaf92754c Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 16 May 2024 00:58:47 -0700 Subject: [PATCH 38/93] Update django-allauth to 0.63.0 (#5070) --- {{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 1b10a113c..21d59d6f2 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -31,7 +31,7 @@ uvicorn[standard]==0.29.0 # https://github.com/encode/uvicorn django==4.2.13 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.11.2 # https://github.com/joke2k/django-environ django-model-utils==4.5.1 # https://github.com/jazzband/django-model-utils -django-allauth[mfa]==0.62.1 # https://github.com/pennersr/django-allauth +django-allauth[mfa]==0.63.0 # https://github.com/pennersr/django-allauth django-crispy-forms==2.1 # https://github.com/django-crispy-forms/django-crispy-forms crispy-bootstrap5==2024.2 # https://github.com/django-crispy-forms/crispy-bootstrap5 {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} From f29c1c67e39b3ff0d0033cd75f392c037c1ce8aa Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 16 May 2024 07:59:28 +0000 Subject: [PATCH 39/93] Update Contributors --- .github/contributors.json | 5 +++++ CONTRIBUTORS.md | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/.github/contributors.json b/.github/contributors.json index b74dc4d15..7497e82e3 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1568,5 +1568,10 @@ "name": "Marios Frixou", "github_login": "frixou89", "twitter_username": "" + }, + { + "name": "Geo Maciolek", + "github_login": "GeoMaciolek", + "twitter_username": "" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 595e9924a..a7681246d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -887,6 +887,13 @@ Listed in alphabetical order. + + Geo Maciolek + + GeoMaciolek + + + ghazi-git From 2f9051fbbda2ca3a61f7f512be56a2ceb46d5c05 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 16 May 2024 07:50:55 -0700 Subject: [PATCH 40/93] Update sentry-sdk to 2.2.0 (#5074) --- {{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 65f82e57a..7128fb0d4 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg[c]==3.1.19 # https://github.com/psycopg/psycopg Collectfast==2.2.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==2.1.1 # https://github.com/getsentry/sentry-python +sentry-sdk==2.2.0 # https://github.com/getsentry/sentry-python {%- endif %} {%- if cookiecutter.use_docker == "n" and cookiecutter.windows == "y" %} hiredis==2.3.2 # https://github.com/redis/hiredis-py From fdf0254392ed88cb246985726fd94eae610f0bb2 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 17 May 2024 02:15:22 +0000 Subject: [PATCH 41/93] Release 2024.05.16 --- CHANGELOG.md | 13 +++++++++++++ setup.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f59eb5a9..459b6091b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,19 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.05.16 + + +### Documentation + +- Update Two scoops of Django book link & image ([#5073](https://github.com/cookiecutter/cookiecutter-django/pull/5073)) + +### Updated + +- Update sentry-sdk to 2.2.0 ([#5074](https://github.com/cookiecutter/cookiecutter-django/pull/5074)) + +- Update django-allauth to 0.63.0 ([#5070](https://github.com/cookiecutter/cookiecutter-django/pull/5070)) + ## 2024.05.15 diff --git a/setup.py b/setup.py index 27c7cd671..17d9e2b0d 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.05.15" +version = "2024.05.16" with open("README.md") as readme_file: long_description = readme_file.read() From 5a51ef224728febd9b36310e201983b93a9251a0 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 17 May 2024 04:55:58 -0700 Subject: [PATCH 42/93] Update django-allauth from 0.63.0 to 0.63.1 (#5076) --- {{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 21d59d6f2..5cfa245c2 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -31,7 +31,7 @@ uvicorn[standard]==0.29.0 # https://github.com/encode/uvicorn django==4.2.13 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.11.2 # https://github.com/joke2k/django-environ django-model-utils==4.5.1 # https://github.com/jazzband/django-model-utils -django-allauth[mfa]==0.63.0 # https://github.com/pennersr/django-allauth +django-allauth[mfa]==0.63.1 # https://github.com/pennersr/django-allauth django-crispy-forms==2.1 # https://github.com/django-crispy-forms/django-crispy-forms crispy-bootstrap5==2024.2 # https://github.com/django-crispy-forms/crispy-bootstrap5 {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} From b9f6d8875e687b904b5a4b7521f627d62187e2d5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 18 May 2024 02:15:34 +0000 Subject: [PATCH 43/93] Release 2024.05.17 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 459b6091b..274122dfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.05.17 + + +### Updated + +- Update django-allauth to 0.63.1 ([#5076](https://github.com/cookiecutter/cookiecutter-django/pull/5076)) + ## 2024.05.16 diff --git a/setup.py b/setup.py index 17d9e2b0d..7e6245082 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.05.16" +version = "2024.05.17" with open("README.md") as readme_file: long_description = readme_file.read() From b119eae9b4937e56fcbc83349b7456df143927de Mon Sep 17 00:00:00 2001 From: Jens Kaeske <39417308+jkaeske@users.noreply.github.com> Date: Sat, 18 May 2024 22:53:52 +0200 Subject: [PATCH 44/93] Fix redirect error when forcing allauth login in admin site (#5078) --- .../{{cookiecutter.project_slug}}/users/admin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py index 70f829256..40086de7f 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py @@ -1,7 +1,7 @@ +from allauth.account.decorators import secure_admin_login from django.conf import settings from django.contrib import admin from django.contrib.auth import admin as auth_admin -from django.contrib.auth.decorators import login_required from django.utils.translation import gettext_lazy as _ from .forms import UserAdminChangeForm @@ -11,7 +11,8 @@ from .models import User if settings.DJANGO_ADMIN_FORCE_ALLAUTH: # Force the `admin` sign in process to go through the `django-allauth` workflow: # https://docs.allauth.org/en/latest/common/admin.html#admin - admin.site.login = login_required(admin.site.login) # type: ignore[method-assign] + admin.autodiscover() + admin.site.login = secure_admin_login(admin.site.login) # type: ignore[method-assign] @admin.register(User) From 9e721a8a02c3250a33a9c18be3547098ffd60082 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 19 May 2024 02:17:13 +0000 Subject: [PATCH 45/93] Release 2024.05.18 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 274122dfb..8918032b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.05.18 + + +### Fixed + +- Fix redirect error when forcing allauth login in admin site ([#5078](https://github.com/cookiecutter/cookiecutter-django/pull/5078)) + ## 2024.05.17 diff --git a/setup.py b/setup.py index 7e6245082..5863ba9de 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.05.17" +version = "2024.05.18" with open("README.md") as readme_file: long_description = readme_file.read() From 6db133df424c81a857f683151522a198fc79a79f Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 20 May 2024 02:51:31 -0700 Subject: [PATCH 46/93] Update pytest to 8.2.1 (#5079) * Update pytest from 8.2.0 to 8.2.1 * Update pytest from 8.2.0 to 8.2.1 --- requirements.txt | 2 +- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 47d06222f..beef504b8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ pre-commit==3.7.1 # Testing # ------------------------------------------------------------------------------ tox==4.15.0 -pytest==8.2.0 +pytest==8.2.1 pytest-xdist==3.6.1 pytest-cookies==0.7.0 pytest-instafail==0.5.0 diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 67925b4ed..2e4423f30 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -15,7 +15,7 @@ watchfiles==0.21.0 # https://github.com/samuelcolvin/watchfiles # ------------------------------------------------------------------------------ mypy==1.10.0 # https://github.com/python/mypy django-stubs[compatible-mypy]==5.0.0 # https://github.com/typeddjango/django-stubs -pytest==8.2.0 # https://github.com/pytest-dev/pytest +pytest==8.2.1 # https://github.com/pytest-dev/pytest pytest-sugar==1.0.0 # https://github.com/Frozenball/pytest-sugar {%- if cookiecutter.use_drf == "y" %} djangorestframework-stubs[compatible-mypy]==3.15.0 # https://github.com/typeddjango/djangorestframework-stubs From 4e48f9e1ec931883db3ceed96c1bd17361f6f5c5 Mon Sep 17 00:00:00 2001 From: Nadav Peretz Date: Mon, 20 May 2024 14:47:39 -0300 Subject: [PATCH 47/93] Fix PyCharm Run Configurations After local.yml Rename (#5080) --- .../.idea/runConfigurations/docker_compose_up_django.xml | 2 +- .../.idea/runConfigurations/docker_compose_up_docs.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_django.xml b/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_django.xml index e84c5ffdd..0eabd93c8 100644 --- a/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_django.xml +++ b/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_django.xml @@ -15,7 +15,7 @@ {%- endif %} -