From e354622bb77656b2f7dc8ca670321e1d262f7780 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 24 Jan 2024 10:25:58 +0000 Subject: [PATCH 001/234] Auto-close issue marked as "wontfix" --- .github/workflows/issue-manager.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/issue-manager.yml b/.github/workflows/issue-manager.yml index e1bb614b1..715aca133 100644 --- a/.github/workflows/issue-manager.yml +++ b/.github/workflows/issue-manager.yml @@ -39,5 +39,9 @@ jobs: "waiting": { "delay": 864000, "message": "Automatically closing after waiting for additional info. To re-open, please provide the additional information requested." + }, + "wontfix": { + "delay": 864000, + "message": "As discussed, we won't be implementing this. Automatically closing." } } From 1899b485e6769e66a14456233242cb7d7af100a5 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 24 Jan 2024 15:32:44 +0000 Subject: [PATCH 002/234] Migrate to the unified `STORAGES` setting added in Django 4.2 (#4477) * changed settings.py vars to reflect django-4.2 * Fix code style * removed overriding and if block in variable * Fix code style * Remove comment * Add back default file storage --------- Co-authored-by: Manan Bhavsar --- .../config/settings/production.py | 63 ++++++++++++------- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 971efa396..70dc6d7dd 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -103,35 +103,52 @@ AZURE_CONTAINER = env("DJANGO_AZURE_CONTAINER_NAME") {% endif -%} {% if cookiecutter.cloud_provider != 'None' or cookiecutter.use_whitenoise == 'y' -%} -# STATIC +# STATIC & MEDIA # ------------------------ -{% endif -%} -{% if cookiecutter.use_whitenoise == 'y' -%} -STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" -{% elif cookiecutter.cloud_provider == 'AWS' -%} -STATICFILES_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.StaticS3Storage" +STORAGES = { +{%- if cookiecutter.use_whitenoise == 'y' %} + "default": { + "BACKEND": "django.core.files.storage.FileSystemStorage", + }, + "staticfiles": { + "BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage", + }, +{%- elif cookiecutter.cloud_provider == 'AWS' %} + "default": { + "BACKEND": "{{cookiecutter.project_slug}}.utils.storages.MediaS3Storage", + }, + "staticfiles": { + "BACKEND": "{{cookiecutter.project_slug}}.utils.storages.StaticS3Storage", + }, +{%- elif cookiecutter.cloud_provider == 'GCP' %} + "default": { + "BACKEND": "{{cookiecutter.project_slug}}.utils.storages.MediaGoogleCloudStorage", + }, + "staticfiles": { + "BACKEND": "{{cookiecutter.project_slug}}.utils.storages.StaticGoogleCloudStorage", + }, +{%- elif cookiecutter.cloud_provider == 'Azure' %} + "default": { + "BACKEND": "{{cookiecutter.project_slug}}.utils.storages.MediaAzureStorage", + }, + "staticfiles": { + "BACKEND": "{{cookiecutter.project_slug}}.utils.storages.StaticAzureStorage", + }, +{%- endif %} +} +{%- endif %} + +{%- if cookiecutter.cloud_provider == 'AWS' %} +MEDIA_URL = f"https://{aws_s3_domain}/media/" COLLECTFAST_STRATEGY = "collectfast.strategies.boto3.Boto3Strategy" STATIC_URL = f"https://{aws_s3_domain}/static/" -{% elif cookiecutter.cloud_provider == 'GCP' -%} -STATICFILES_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.StaticGoogleCloudStorage" +{%- elif cookiecutter.cloud_provider == 'GCP' %} +MEDIA_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/media/" COLLECTFAST_STRATEGY = "collectfast.strategies.gcloud.GoogleCloudStrategy" STATIC_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/static/" -{% elif cookiecutter.cloud_provider == 'Azure' -%} -STATICFILES_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.StaticAzureStorage" -STATIC_URL = f"https://{AZURE_ACCOUNT_NAME}.blob.core.windows.net/static/" -{% endif -%} - -# MEDIA -# ------------------------------------------------------------------------------ -{%- if cookiecutter.cloud_provider == 'AWS' %} -DEFAULT_FILE_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.MediaS3Storage" -MEDIA_URL = f"https://{aws_s3_domain}/media/" -{%- elif cookiecutter.cloud_provider == 'GCP' %} -DEFAULT_FILE_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.MediaGoogleCloudStorage" -MEDIA_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/media/" {%- elif cookiecutter.cloud_provider == 'Azure' %} -DEFAULT_FILE_STORAGE = "{{cookiecutter.project_slug}}.utils.storages.MediaAzureStorage" MEDIA_URL = f"https://{AZURE_ACCOUNT_NAME}.blob.core.windows.net/media/" +STATIC_URL = f"https://{AZURE_ACCOUNT_NAME}.blob.core.windows.net/static/" {%- endif %} # EMAIL @@ -230,7 +247,7 @@ COMPRESS_ENABLED = env.bool("COMPRESS_ENABLED", default=True) COMPRESS_STORAGE = "compressor.storage.GzipCompressorFileStorage" {%- elif cookiecutter.cloud_provider in ('AWS', 'GCP', 'Azure') and cookiecutter.use_whitenoise == 'n' %} # https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_STORAGE -COMPRESS_STORAGE = STATICFILES_STORAGE +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' %} # noqa: F405{% endif %} From cd0a76c46f4623d8fb5903aa1faf06a3d0c0b81a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 24 Jan 2024 07:34:24 -0800 Subject: [PATCH 003/234] Update uvicorn to 0.27.0 (#4800) --- {{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 207306432..f74a6e64d 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -23,7 +23,7 @@ flower==2.0.1 # https://github.com/mher/flower {%- endif %} {%- endif %} {%- if cookiecutter.use_async == 'y' %} -uvicorn[standard]==0.26.0 # https://github.com/encode/uvicorn +uvicorn[standard]==0.27.0 # https://github.com/encode/uvicorn {%- endif %} # Django From 4da8386f9cb53447b73be88b13a401232a394546 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 25 Jan 2024 02:17:27 +0000 Subject: [PATCH 004/234] Release 2024.01.24 --- CHANGELOG.md | 11 +++++++++++ setup.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 707bef268..f444e05ca 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.01.24 + + +### Changed + +- Migrate to the unified `STORAGES` setting added in Django 4.2 ([#4477](https://github.com/cookiecutter/cookiecutter-django/pull/4477)) + +### Updated + +- Update uvicorn to 0.27.0 ([#4800](https://github.com/cookiecutter/cookiecutter-django/pull/4800)) + ## 2024.01.21 diff --git a/setup.py b/setup.py index 8aa7a43bb..aaf575425 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.01.21" +version = "2024.01.24" with open("README.md") as readme_file: long_description = readme_file.read() From bda89eaa068407393b47a2071c87676becfd81fa Mon Sep 17 00:00:00 2001 From: Jens Kaeske <39417308+jkaeske@users.noreply.github.com> Date: Thu, 25 Jan 2024 10:01:27 +0100 Subject: [PATCH 005/234] Replace custom static & media storage classes by passing options in the `STORAGES` setting (#4803) The custom cloud storages module has been deleted, and the settings have been updated to use the storage backend settings directly from each cloud provider's storage backend libraries. These changes have simplified the cloud storage configuration for each cloud provider in the production settings file. --- hooks/post_gen_project.py | 5 --- .../config/settings/production.py | 35 ++++++++++++++---- .../utils/__init__.py | 0 .../utils/storages.py | 36 ------------------- 4 files changed, 29 insertions(+), 47 deletions(-) delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/__init__.py delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/storages.py diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 37f96efc0..685bf90a7 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -429,10 +429,6 @@ def remove_drf_starter_files(): os.remove(os.path.join("{{cookiecutter.project_slug}}", "users", "tests", "test_swagger.py")) -def remove_storages_module(): - os.remove(os.path.join("{{cookiecutter.project_slug}}", "utils", "storages.py")) - - def main(): debug = "{{ cookiecutter.debug }}".lower() == "y" @@ -499,7 +495,6 @@ def main(): WARNING + "You chose to not use any cloud providers nor Docker, " "media files won't be served in production." + TERMINATOR ) - remove_storages_module() if "{{ cookiecutter.use_celery }}".lower() == "n": remove_celery_files() diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 70dc6d7dd..7f6293571 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -115,24 +115,47 @@ STORAGES = { }, {%- elif cookiecutter.cloud_provider == 'AWS' %} "default": { - "BACKEND": "{{cookiecutter.project_slug}}.utils.storages.MediaS3Storage", + "BACKEND": "storages.backends.s3.S3Storage", + "OPTIONS": { + "location": "media", + "file_overwrite": False, + }, }, "staticfiles": { - "BACKEND": "{{cookiecutter.project_slug}}.utils.storages.StaticS3Storage", + "BACKEND": "storages.backends.s3.S3Storage", + "OPTIONS": { + "location": "static", + "default_acl": "public-read", + }, }, {%- elif cookiecutter.cloud_provider == 'GCP' %} "default": { - "BACKEND": "{{cookiecutter.project_slug}}.utils.storages.MediaGoogleCloudStorage", + "BACKEND": "storages.backends.gcloud.GoogleCloudStorage", + "OPTIONS": { + "location": "media", + "file_overwrite": False, + }, }, "staticfiles": { - "BACKEND": "{{cookiecutter.project_slug}}.utils.storages.StaticGoogleCloudStorage", + "BACKEND": "storages.backends.gcloud.GoogleCloudStorage", + "OPTIONS": { + "location": "static", + "default_acl": "publicRead", + }, }, {%- elif cookiecutter.cloud_provider == 'Azure' %} "default": { - "BACKEND": "{{cookiecutter.project_slug}}.utils.storages.MediaAzureStorage", + "BACKEND": "storages.backends.azure_storage.AzureStorage", + "OPTIONS": { + "location": "media", + "file_overwrite": False, + }, }, "staticfiles": { - "BACKEND": "{{cookiecutter.project_slug}}.utils.storages.StaticAzureStorage", + "BACKEND": "storages.backends.azure_storage.AzureStorage", + "OPTIONS": { + "location": "static", + }, }, {%- endif %} } diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/__init__.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/storages.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/storages.py deleted file mode 100644 index cc055378a..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/storages.py +++ /dev/null @@ -1,36 +0,0 @@ -{% if cookiecutter.cloud_provider == 'AWS' -%} -from storages.backends.s3 import S3Storage - - -class StaticS3Storage(S3Storage): - location = "static" - default_acl = "public-read" - - -class MediaS3Storage(S3Storage): - location = "media" - file_overwrite = False -{%- elif cookiecutter.cloud_provider == 'GCP' -%} -from storages.backends.gcloud import GoogleCloudStorage - - -class StaticGoogleCloudStorage(GoogleCloudStorage): - location = "static" - default_acl = "publicRead" - - -class MediaGoogleCloudStorage(GoogleCloudStorage): - location = "media" - file_overwrite = False -{%- elif cookiecutter.cloud_provider == 'Azure' -%} -from storages.backends.azure_storage import AzureStorage - - -class StaticAzureStorage(AzureStorage): - location = "static" - - -class MediaAzureStorage(AzureStorage): - location = "media" - file_overwrite = False -{%- endif %} From 956469849a997c65d0598c6491fcc7b288f4256b Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 25 Jan 2024 09:02:05 +0000 Subject: [PATCH 006/234] 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 723c72083..1e50217f0 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1508,5 +1508,10 @@ "name": "Nix Siow", "github_login": "nixsiow", "twitter_username": "nixsiow" + }, + { + "name": "Jens Kaeske", + "github_login": "jkaeske", + "twitter_username": "" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9a384d141..39699a723 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1076,6 +1076,13 @@ Listed in alphabetical order. + + Jens Kaeske + + jkaeske + + + Jens Nilsson From c7eded8644bc565eaf86401037a77f9969c15b9a Mon Sep 17 00:00:00 2001 From: Tim Freund Date: Thu, 25 Jan 2024 04:12:07 -0500 Subject: [PATCH 007/234] Add registry to Docker images names (#4804) Prepending docker.io/ to image names allows projects to be run in alternate runtimes such as podman-compose without additional configuration. --- .../compose/local/django/Dockerfile | 6 +++--- .../compose/local/docs/Dockerfile | 6 +++--- .../compose/local/node/Dockerfile | 2 +- .../compose/production/aws/Dockerfile | 2 +- .../compose/production/django/Dockerfile | 8 ++++---- .../compose/production/nginx/Dockerfile | 2 +- .../compose/production/postgres/Dockerfile | 2 +- .../compose/production/traefik/Dockerfile | 2 +- {{cookiecutter.project_slug}}/local.yml | 4 ++-- {{cookiecutter.project_slug}}/production.yml | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index 703474a6f..575a4518a 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -1,8 +1,8 @@ # define an alias for the specific python version used in this file. -FROM python:3.11.7-slim-bookworm as python +FROM docker.io/python:3.11.7-slim-bookworm as python # Python build stage -FROM python as python-build-stage +FROM docker.io/python as python-build-stage ARG BUILD_ENVIRONMENT=local @@ -22,7 +22,7 @@ RUN pip wheel --wheel-dir /usr/src/app/wheels \ # Python 'run' stage -FROM python as python-run-stage +FROM docker.io/python as python-run-stage ARG BUILD_ENVIRONMENT=local ARG APP_HOME=/app diff --git a/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile index 41ab15b9f..2b68c84b2 100644 --- a/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile @@ -1,9 +1,9 @@ # define an alias for the specific python version used in this file. -FROM python:3.11.7-slim-bookworm as python +FROM docker.io/python:3.11.7-slim-bookworm as python # Python build stage -FROM python as python-build-stage +FROM docker.io/python as python-build-stage ENV PYTHONDONTWRITEBYTECODE 1 @@ -26,7 +26,7 @@ RUN pip wheel --no-cache-dir --wheel-dir /usr/src/app/wheels \ # Python 'run' stage -FROM python as python-run-stage +FROM docker.io/python as python-run-stage ARG BUILD_ENVIRONMENT ENV PYTHONUNBUFFERED 1 diff --git a/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile index 41f42b625..0848ecaf8 100644 --- a/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20-bookworm-slim +FROM docker.io/node:20-bookworm-slim WORKDIR /app diff --git a/{{cookiecutter.project_slug}}/compose/production/aws/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/aws/Dockerfile index 4d1ecbb20..36eea7f8c 100644 --- a/{{cookiecutter.project_slug}}/compose/production/aws/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/aws/Dockerfile @@ -1,4 +1,4 @@ -FROM garland/aws-cli-docker:1.16.140 +FROM docker.io/garland/aws-cli-docker:1.16.140 COPY ./compose/production/aws/maintenance /usr/local/bin/maintenance COPY ./compose/production/postgres/maintenance/_sourced /usr/local/bin/maintenance/_sourced diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index e0da6063c..079f6bd78 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -1,5 +1,5 @@ {% if cookiecutter.frontend_pipeline in ['Gulp', 'Webpack'] -%} -FROM node:20-bookworm-slim as client-builder +FROM docker.io/node:20-bookworm-slim as client-builder ARG APP_HOME=/app WORKDIR ${APP_HOME} @@ -25,10 +25,10 @@ RUN npm run build {%- endif %} # define an alias for the specific python version used in this file. -FROM python:3.11.7-slim-bookworm as python +FROM docker.io/python:3.11.7-slim-bookworm as python # Python build stage -FROM python as python-build-stage +FROM docker.io/python as python-build-stage ARG BUILD_ENVIRONMENT=production @@ -48,7 +48,7 @@ RUN pip wheel --wheel-dir /usr/src/app/wheels \ # Python 'run' stage -FROM python as python-run-stage +FROM docker.io/python as python-run-stage ARG BUILD_ENVIRONMENT=production ARG APP_HOME=/app diff --git a/{{cookiecutter.project_slug}}/compose/production/nginx/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/nginx/Dockerfile index 911b16f71..ec2ad35cb 100644 --- a/{{cookiecutter.project_slug}}/compose/production/nginx/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/nginx/Dockerfile @@ -1,2 +1,2 @@ -FROM nginx:1.17.8-alpine +FROM docker.io/nginx:1.17.8-alpine COPY ./compose/production/nginx/default.conf /etc/nginx/conf.d/default.conf diff --git a/{{cookiecutter.project_slug}}/compose/production/postgres/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/postgres/Dockerfile index eca29bada..5da8982f4 100644 --- a/{{cookiecutter.project_slug}}/compose/production/postgres/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/postgres/Dockerfile @@ -1,4 +1,4 @@ -FROM postgres:{{ cookiecutter.postgresql_version }} +FROM docker.io/postgres:{{ cookiecutter.postgresql_version }} COPY ./compose/production/postgres/maintenance /usr/local/bin/maintenance RUN chmod +x /usr/local/bin/maintenance/* diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile index 321551ead..c32b15873 100644 --- a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile @@ -1,4 +1,4 @@ -FROM traefik:2.10.7 +FROM docker.io/traefik:2.10.7 RUN mkdir -p /etc/traefik/acme \ && touch /etc/traefik/acme/acme.json \ && chmod 600 /etc/traefik/acme/acme.json diff --git a/{{cookiecutter.project_slug}}/local.yml b/{{cookiecutter.project_slug}}/local.yml index 6609f8053..d924b739f 100644 --- a/{{cookiecutter.project_slug}}/local.yml +++ b/{{cookiecutter.project_slug}}/local.yml @@ -58,7 +58,7 @@ services: {%- if cookiecutter.use_mailpit == 'y' %} mailpit: - image: axllent/mailpit:latest + image: docker.io/axllent/mailpit:latest container_name: {{ cookiecutter.project_slug }}_local_mailpit ports: - "8025:8025" @@ -67,7 +67,7 @@ services: {%- if cookiecutter.use_celery == 'y' %} redis: - image: redis:6 + image: docker.io/redis:6 container_name: {{ cookiecutter.project_slug }}_local_redis celeryworker: diff --git a/{{cookiecutter.project_slug}}/production.yml b/{{cookiecutter.project_slug}}/production.yml index 30d72d61e..f7bf5284f 100644 --- a/{{cookiecutter.project_slug}}/production.yml +++ b/{{cookiecutter.project_slug}}/production.yml @@ -67,7 +67,7 @@ services: {%- endif %} redis: - image: redis:6 + image: docker.io/redis:6 {%- if cookiecutter.use_celery == 'y' %} celeryworker: From 991a1097dda3f87379c009129cc12292f8ac9e82 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 25 Jan 2024 17:51:29 +0000 Subject: [PATCH 008/234] Update python-slugify from 8.0.1 to 8.0.2 --- {{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 f74a6e64d..fedc6edb6 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,4 +1,4 @@ -python-slugify==8.0.1 # https://github.com/un33k/python-slugify +python-slugify==8.0.2 # https://github.com/un33k/python-slugify Pillow==10.2.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} {%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} From cf788ffe61255b3e174564962b7aa07f3d4048d5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 26 Jan 2024 02:11:42 +0000 Subject: [PATCH 009/234] Release 2024.01.25 --- CHANGELOG.md | 9 +++++++++ setup.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f444e05ca..abe8bdc9d 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.01.25 + + +### Changed + +- Replace custom static & media storage classes by passing options in the `STORAGES` setting ([#4803](https://github.com/cookiecutter/cookiecutter-django/pull/4803)) + +- Add registry to Docker images names ([#4804](https://github.com/cookiecutter/cookiecutter-django/pull/4804)) + ## 2024.01.24 diff --git a/setup.py b/setup.py index aaf575425..dca284914 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.01.24" +version = "2024.01.25" with open("README.md") as readme_file: long_description = readme_file.read() From 6301fcc603161c09c68ff2ddfdb061925579e176 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 26 Jan 2024 02:49:52 -0800 Subject: [PATCH 010/234] Update black to 24.1.0 (#4806) * Update black from 23.12.1 to 24.1.0 * Update black from 23.12.1 to 24.1.0 * Update black pre-commit hooks * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix a few styling issues for black v24 --------- Co-authored-by: Bruno Alla Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- hooks/post_gen_project.py | 1 + hooks/pre_gen_project.py | 1 + requirements.txt | 2 +- scripts/create_django_issue.py | 1 + tests/test_hooks.py | 1 + {{cookiecutter.project_slug}}/.pre-commit-config.yaml | 2 +- {{cookiecutter.project_slug}}/config/asgi.py | 1 + {{cookiecutter.project_slug}}/config/settings/base.py | 5 ++--- {{cookiecutter.project_slug}}/config/settings/test.py | 2 +- {{cookiecutter.project_slug}}/config/wsgi.py | 1 + {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- .../{{cookiecutter.project_slug}}/users/tests/test_forms.py | 5 ++--- 13 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8c10de974..bfa50e96a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: exclude: hooks/ - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.0 hooks: - id: black diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 685bf90a7..1ddab0636 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -8,6 +8,7 @@ NOTE: TODO: restrict Cookiecutter Django project initialization to Python 3.x environments only """ + from __future__ import print_function import json diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index 33dc2e834..2956b9ab4 100644 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -7,6 +7,7 @@ NOTE: TODO: restrict Cookiecutter Django project initialization to Python 3.x environments only """ + from __future__ import print_function import sys diff --git a/requirements.txt b/requirements.txt index aadf4abb1..38df1e175 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -black==23.12.1 +black==24.1.0 isort==5.13.2 flake8==7.0.0 django-upgrade==1.15.0 diff --git a/scripts/create_django_issue.py b/scripts/create_django_issue.py index f9ff76545..2e59f18b0 100644 --- a/scripts/create_django_issue.py +++ b/scripts/create_django_issue.py @@ -6,6 +6,7 @@ patches, only comparing major and minor version numbers. This script handles when there are multiple Django versions that need to keep up to date. """ + from __future__ import annotations import os diff --git a/tests/test_hooks.py b/tests/test_hooks.py index 6afdc400b..2ccac84b2 100644 --- a/tests/test_hooks.py +++ b/tests/test_hooks.py @@ -1,4 +1,5 @@ """Unit tests for the hooks""" + import os from pathlib import Path diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index c0e1db7ca..4eea9c62a 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -40,7 +40,7 @@ repos: args: [--py311-plus] - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.0 hooks: - id: black diff --git a/{{cookiecutter.project_slug}}/config/asgi.py b/{{cookiecutter.project_slug}}/config/asgi.py index 65e76ca0a..c391bf87b 100644 --- a/{{cookiecutter.project_slug}}/config/asgi.py +++ b/{{cookiecutter.project_slug}}/config/asgi.py @@ -7,6 +7,7 @@ For more information on this file, see https://docs.djangoproject.com/en/dev/howto/deployment/asgi/ """ + import os import sys from pathlib import Path diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index ecc5a540d..3bf3a73cc 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -1,6 +1,5 @@ -""" -Base settings to build other settings files upon. -""" +"""Base settings to build other settings files upon.""" + from pathlib import Path import environ diff --git a/{{cookiecutter.project_slug}}/config/settings/test.py b/{{cookiecutter.project_slug}}/config/settings/test.py index 68126182e..4d64c63f2 100644 --- a/{{cookiecutter.project_slug}}/config/settings/test.py +++ b/{{cookiecutter.project_slug}}/config/settings/test.py @@ -32,7 +32,7 @@ TEMPLATES[0]["OPTIONS"]["debug"] = True # type: ignore # noqa: F405 # MEDIA # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#media-url -MEDIA_URL = 'http://media.testserver' +MEDIA_URL = "http://media.testserver" {%- if cookiecutter.frontend_pipeline == 'Webpack' %} # django-webpack-loader diff --git a/{{cookiecutter.project_slug}}/config/wsgi.py b/{{cookiecutter.project_slug}}/config/wsgi.py index 3fd809ef3..1dbd8a8d8 100644 --- a/{{cookiecutter.project_slug}}/config/wsgi.py +++ b/{{cookiecutter.project_slug}}/config/wsgi.py @@ -13,6 +13,7 @@ middleware here, or combine a Django application with an application of another framework. """ + import os import sys from pathlib import Path diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 2a80055c0..81e87ac84 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -31,7 +31,7 @@ sphinx-autobuild==2021.3.14 # https://github.com/GaretJax/sphinx-autobuild flake8==7.0.0 # https://github.com/PyCQA/flake8 flake8-isort==6.1.1 # https://github.com/gforcada/flake8-isort coverage==7.4.0 # https://github.com/nedbat/coveragepy -black==23.12.1 # https://github.com/psf/black +black==24.1.0 # https://github.com/psf/black djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pylint-django==2.5.5 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py index 023aad056..ca624c89a 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py @@ -1,6 +1,5 @@ -""" -Module for all Form Tests. -""" +"""Module for all Form Tests.""" + from django.utils.translation import gettext_lazy as _ from {{ cookiecutter.project_slug }}.users.forms import UserAdminCreationForm From 8324c160e8461b534a008cd176069ffa98f34f27 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 27 Jan 2024 02:08:59 +0000 Subject: [PATCH 011/234] Release 2024.01.26 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abe8bdc9d..060c77dd7 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.01.26 + + +### Updated + +- Update black to 24.1.0 ([#4806](https://github.com/cookiecutter/cookiecutter-django/pull/4806)) + ## 2024.01.25 diff --git a/setup.py b/setup.py index dca284914..79c28a182 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.01.25" +version = "2024.01.26" with open("README.md") as readme_file: long_description = readme_file.read() From e4d6b98c93883a540f1cce0a1d56c55683878418 Mon Sep 17 00:00:00 2001 From: Jelmer Draaijer Date: Sat, 27 Jan 2024 10:34:23 +0100 Subject: [PATCH 012/234] Do not show webpack devserver overlay for warnings --- {{cookiecutter.project_slug}}/webpack/dev.config.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/{{cookiecutter.project_slug}}/webpack/dev.config.js b/{{cookiecutter.project_slug}}/webpack/dev.config.js index c2f14abb1..8276c3489 100644 --- a/{{cookiecutter.project_slug}}/webpack/dev.config.js +++ b/{{cookiecutter.project_slug}}/webpack/dev.config.js @@ -13,6 +13,13 @@ module.exports = merge(commonConfig, { '/': 'http://django:8000', {%- endif %} }, + client: { + overlay: { + errors: true, + warnings: false, + runtimeErrors: true, + }, + }, // We need hot=false (Disable HMR) to set liveReload=true hot: false, liveReload: true, From b68913cceffb3b863079652fa8e0eff97e63dadf Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 27 Jan 2024 02:17:24 -0800 Subject: [PATCH 013/234] Update coverage from 7.4.0 to 7.4.1 (#4807) --- {{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 81e87ac84..41d500240 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -30,7 +30,7 @@ sphinx-autobuild==2021.3.14 # https://github.com/GaretJax/sphinx-autobuild # ------------------------------------------------------------------------------ flake8==7.0.0 # https://github.com/PyCQA/flake8 flake8-isort==6.1.1 # https://github.com/gforcada/flake8-isort -coverage==7.4.0 # https://github.com/nedbat/coveragepy +coverage==7.4.1 # https://github.com/nedbat/coveragepy black==24.1.0 # https://github.com/psf/black djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pylint-django==2.5.5 # https://github.com/PyCQA/pylint-django From e840b75eba4f54ccbb1e6a7c7c9f4356fcd71733 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 28 Jan 2024 02:11:47 +0000 Subject: [PATCH 014/234] Release 2024.01.27 --- CHANGELOG.md | 13 +++++++++++++ setup.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 060c77dd7..ff3b48038 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.01.27 + + +### Changed + +- Do not show webpack devserver overlay for warnings ([#4809](https://github.com/cookiecutter/cookiecutter-django/pull/4809)) + +### Updated + +- Update python-slugify to 8.0.2 ([#4805](https://github.com/cookiecutter/cookiecutter-django/pull/4805)) + +- Update coverage to 7.4.1 ([#4807](https://github.com/cookiecutter/cookiecutter-django/pull/4807)) + ## 2024.01.26 diff --git a/setup.py b/setup.py index 79c28a182..fe8e09198 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.01.26" +version = "2024.01.27" with open("README.md") as readme_file: long_description = readme_file.read() From c7c16c746c67358259a2c66c46f7a972c348be9b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 28 Jan 2024 02:11:52 +0000 Subject: [PATCH 015/234] Update pytest from 7.4.4 to 8.0.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 38df1e175..807ff98b2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ pre-commit==3.6.0 # Testing # ------------------------------------------------------------------------------ tox==4.12.1 -pytest==7.4.4 +pytest==8.0.0 pytest-xdist==3.5.0 pytest-cookies==0.7.0 pytest-instafail==0.5.0 From a5cf715966bd688cf62611ce3d99522292eae16d Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 28 Jan 2024 02:11:53 +0000 Subject: [PATCH 016/234] Update pytest from 7.4.4 to 8.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 41d500240..13fdea0a1 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.7.1 # https://github.com/python/mypy django-stubs[compatible-mypy]==4.2.7 # https://github.com/typeddjango/django-stubs -pytest==7.4.4 # https://github.com/pytest-dev/pytest +pytest==8.0.0 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.7 # https://github.com/Frozenball/pytest-sugar {%- if cookiecutter.use_drf == "y" %} djangorestframework-stubs[compatible-mypy]==3.14.5 # https://github.com/typeddjango/djangorestframework-stubs From 2ef8d0a78e9e8742c9c4aefcd6a2d02bcd32e074 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 28 Jan 2024 06:30:23 +0000 Subject: [PATCH 017/234] Update black from 24.1.0 to 24.1.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 38df1e175..377b6acd5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -black==24.1.0 +black==24.1.1 isort==5.13.2 flake8==7.0.0 django-upgrade==1.15.0 From d45c042cd7fead3cca6c67ba0aad852ac11f383a Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 28 Jan 2024 06:30:23 +0000 Subject: [PATCH 018/234] Update black from 24.1.0 to 24.1.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 41d500240..306fc08fa 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -31,7 +31,7 @@ sphinx-autobuild==2021.3.14 # https://github.com/GaretJax/sphinx-autobuild flake8==7.0.0 # https://github.com/PyCQA/flake8 flake8-isort==6.1.1 # https://github.com/gforcada/flake8-isort coverage==7.4.1 # https://github.com/nedbat/coveragepy -black==24.1.0 # https://github.com/psf/black +black==24.1.1 # https://github.com/psf/black djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pylint-django==2.5.5 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} From e87b6fad33bc4b18443586368bb1dd618e73c504 Mon Sep 17 00:00:00 2001 From: Jelmer Draaijer Date: Sun, 28 Jan 2024 12:38:24 +0100 Subject: [PATCH 019/234] 'webpack_loader.loader' module has been renamed to 'webpack_loader.loaders' --- {{cookiecutter.project_slug}}/config/settings/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/test.py b/{{cookiecutter.project_slug}}/config/settings/test.py index 4d64c63f2..7c54e0217 100644 --- a/{{cookiecutter.project_slug}}/config/settings/test.py +++ b/{{cookiecutter.project_slug}}/config/settings/test.py @@ -37,7 +37,7 @@ MEDIA_URL = "http://media.testserver" {%- if cookiecutter.frontend_pipeline == 'Webpack' %} # django-webpack-loader # ------------------------------------------------------------------------------ -WEBPACK_LOADER["DEFAULT"]["LOADER_CLASS"] = "webpack_loader.loader.FakeWebpackLoader" # noqa: F405 +WEBPACK_LOADER["DEFAULT"]["LOADER_CLASS"] = "webpack_loader.loaders.FakeWebpackLoader" # noqa: F405 {%- endif %} # Your stuff... From 4f02e397d53ce38604c20762f2473ba26cdfe09d Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 29 Jan 2024 02:23:00 +0000 Subject: [PATCH 020/234] Auto-update pre-commit hooks --- .pre-commit-config.yaml | 2 +- {{cookiecutter.project_slug}}/.pre-commit-config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bfa50e96a..baafb694f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: exclude: hooks/ - repo: https://github.com/psf/black - rev: 24.1.0 + rev: 24.1.1 hooks: - id: black diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 4eea9c62a..12a1f5e81 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -40,7 +40,7 @@ repos: args: [--py311-plus] - repo: https://github.com/psf/black - rev: 24.1.0 + rev: 24.1.1 hooks: - id: black From cce9c0ee007479a74e3c4d8e99c50b8fccc0d187 Mon Sep 17 00:00:00 2001 From: henningbra Date: Mon, 29 Jan 2024 14:09:00 +0100 Subject: [PATCH 021/234] Update mention of coverage config file to `pyproject.toml` in documentation (#4816) * Update testing.rst - coverage config file is now pyproject.toml * Update docs/testing.rst --------- Co-authored-by: Bruno Alla --- docs/testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/testing.rst b/docs/testing.rst index 6387a6e1e..d403a30eb 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -43,7 +43,7 @@ If you're running the project locally with Docker, use these commands instead: : At the root of the project folder, you will find the `pytest.ini` file. You can use this to customize_ the ``pytest`` to your liking. - There is also the `.coveragerc`. This is the configuration file for the ``coverage`` tool. You can find out more about `configuring`_ ``coverage``. + The configuration for ``coverage`` can be found in ``pyproject.toml``. You can find out more about `configuring`_ ``coverage``. .. seealso:: From a11f02de8dde590e7388192ff34a3c060ae58617 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 29 Jan 2024 13:10:31 +0000 Subject: [PATCH 022/234] 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 1e50217f0..c95797b18 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1513,5 +1513,10 @@ "name": "Jens Kaeske", "github_login": "jkaeske", "twitter_username": "" + }, + { + "name": "henningbra", + "github_login": "henningbra", + "twitter_username": "" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 39699a723..7b778f439 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -964,6 +964,13 @@ Listed in alphabetical order. + + henningbra + + henningbra + + + Henrique G. G. Pereira From 5d9efa648b91248ca7bd2541fd622a39b5f21fb3 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 30 Jan 2024 02:10:02 +0000 Subject: [PATCH 023/234] Release 2024.01.29 --- CHANGELOG.md | 17 +++++++++++++++++ setup.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff3b48038..540de8a08 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.01.29 + + +### Changed + +- Fix deprecation warning about renaming of `webpack_loader.loader` to `webpack_loader.loaders` ([#4815](https://github.com/cookiecutter/cookiecutter-django/pull/4815)) + +### Documentation + +- Update mention of coverage config file to `pyproject.toml` in documentation ([#4816](https://github.com/cookiecutter/cookiecutter-django/pull/4816)) + +### Updated + +- Update black to 24.1.1 ([#4814](https://github.com/cookiecutter/cookiecutter-django/pull/4814)) + +- Auto-update pre-commit hooks ([#4817](https://github.com/cookiecutter/cookiecutter-django/pull/4817)) + ## 2024.01.27 diff --git a/setup.py b/setup.py index fe8e09198..3e8917409 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.01.27" +version = "2024.01.29" with open("README.md") as readme_file: long_description = readme_file.read() From db3b1d5117e09c8d8e10ebea0e04c53b1563165e Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 30 Jan 2024 04:02:34 -0800 Subject: [PATCH 024/234] Update pygithub to 2.2.0 (#4821) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 377b6acd5..8203af3ac 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,7 +22,7 @@ pyyaml==6.0.1 # Scripting # ------------------------------------------------------------------------------ -PyGithub==2.1.1 +PyGithub==2.2.0 gitpython==3.1.41 jinja2==3.1.3 requests==2.31.0 From 5d8a538f256c6f67c0a3f61bb3739e4903c82bb0 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 30 Jan 2024 07:44:23 -0800 Subject: [PATCH 025/234] Update uvicorn to 0.27.0.post1 (#4818) --- {{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 fedc6edb6..effd48e57 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -23,7 +23,7 @@ flower==2.0.1 # https://github.com/mher/flower {%- endif %} {%- endif %} {%- if cookiecutter.use_async == 'y' %} -uvicorn[standard]==0.27.0 # https://github.com/encode/uvicorn +uvicorn[standard]==0.27.0.post1 # https://github.com/encode/uvicorn {%- endif %} # Django From 299a2dc550d55b262a9e6e6ad4f3456b3809409a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 30 Jan 2024 07:45:03 -0800 Subject: [PATCH 026/234] Update sentry-sdk to 1.40.0 (#4822) --- {{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 80afd9e18..8a50ecc00 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg[c]==3.1.17 # https://github.com/psycopg/psycopg Collectfast==2.2.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==1.39.2 # https://github.com/getsentry/sentry-python +sentry-sdk==1.40.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 7d75873f09dfd04c8d56bac1b8a3d9abf384e1fb Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 30 Jan 2024 07:46:16 -0800 Subject: [PATCH 027/234] Update pytest-django to 4.8.0 (#4823) --- {{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 306fc08fa..4856257df 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -46,4 +46,4 @@ factory-boy==3.3.0 # https://github.com/FactoryBoy/factory_boy django-debug-toolbar==4.2.0 # https://github.com/jazzband/django-debug-toolbar django-extensions==3.2.3 # https://github.com/django-extensions/django-extensions django-coverage-plugin==3.1.0 # https://github.com/nedbat/django_coverage_plugin -pytest-django==4.7.0 # https://github.com/pytest-dev/pytest-django +pytest-django==4.8.0 # https://github.com/pytest-dev/pytest-django From f3cf85500cf641f2439809b56a696415812a7a72 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 31 Jan 2024 02:10:36 +0000 Subject: [PATCH 028/234] Release 2024.01.30 --- CHANGELOG.md | 11 +++++++++++ setup.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 540de8a08..c917528ce 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.01.30 + + +### Updated + +- Update pytest-django to 4.8.0 ([#4823](https://github.com/cookiecutter/cookiecutter-django/pull/4823)) + +- Update sentry-sdk to 1.40.0 ([#4822](https://github.com/cookiecutter/cookiecutter-django/pull/4822)) + +- Update uvicorn to 0.27.0.post1 ([#4818](https://github.com/cookiecutter/cookiecutter-django/pull/4818)) + ## 2024.01.29 diff --git a/setup.py b/setup.py index 3e8917409..de29b44d1 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.01.29" +version = "2024.01.30" with open("README.md") as readme_file: long_description = readme_file.read() From b556cef533de816fa21484d7131dc0825ec2da2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Jan 2024 10:20:08 +0000 Subject: [PATCH 029/234] Bump tiangolo/issue-manager from 0.4.1 to 0.5.0 (#4825) Bumps [tiangolo/issue-manager](https://github.com/tiangolo/issue-manager) from 0.4.1 to 0.5.0. - [Release notes](https://github.com/tiangolo/issue-manager/releases) - [Commits](https://github.com/tiangolo/issue-manager/compare/0.4.1...0.5.0) --- updated-dependencies: - dependency-name: tiangolo/issue-manager dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/issue-manager.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue-manager.yml b/.github/workflows/issue-manager.yml index 715aca133..103612cfe 100644 --- a/.github/workflows/issue-manager.yml +++ b/.github/workflows/issue-manager.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: tiangolo/issue-manager@0.4.1 + - uses: tiangolo/issue-manager@0.5.0 with: token: ${{ secrets.GITHUB_TOKEN }} config: > From 9ea2365d2ff913b99681fea6cb097e9fe8f8d5ac Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 31 Jan 2024 12:02:22 -0800 Subject: [PATCH 030/234] Update python-slugify to 8.0.3 (#4826) --- {{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 effd48e57..addb67406 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,4 +1,4 @@ -python-slugify==8.0.2 # https://github.com/un33k/python-slugify +python-slugify==8.0.3 # https://github.com/un33k/python-slugify Pillow==10.2.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} {%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} From 102a94f1aa49da22f68330c3c55f2c7b2f62d589 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 1 Feb 2024 02:12:57 +0000 Subject: [PATCH 031/234] Release 2024.01.31 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c917528ce..e6c1cdc3f 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.01.31 + + +### Updated + +- Update python-slugify to 8.0.3 ([#4826](https://github.com/cookiecutter/cookiecutter-django/pull/4826)) + ## 2024.01.30 diff --git a/setup.py b/setup.py index de29b44d1..47c5298ab 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.01.30" +version = "2024.01.31" with open("README.md") as readme_file: long_description = readme_file.read() From f4086f83a740d6b8062aa02db3d03d57eb6e7b06 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 05:18:48 +0000 Subject: [PATCH 032/234] Bump peter-evans/create-pull-request from 5 to 6 Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 5 to 6. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v5...v6) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/pre-commit-autoupdate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml index bfd906cea..0ad414398 100644 --- a/.github/workflows/pre-commit-autoupdate.yml +++ b/.github/workflows/pre-commit-autoupdate.yml @@ -37,7 +37,7 @@ jobs: run: pre-commit autoupdate - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.GITHUB_TOKEN }} branch: update/pre-commit-autoupdate From 6635886302d3eecfa63aff64a13cf0dba554b7c4 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 1 Feb 2024 19:59:15 +0000 Subject: [PATCH 033/234] Update pytest-sugar from 0.9.7 to 1.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 4856257df..544508b41 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -16,7 +16,7 @@ watchfiles==0.21.0 # https://github.com/samuelcolvin/watchfiles mypy==1.7.1 # https://github.com/python/mypy django-stubs[compatible-mypy]==4.2.7 # https://github.com/typeddjango/django-stubs pytest==7.4.4 # https://github.com/pytest-dev/pytest -pytest-sugar==0.9.7 # https://github.com/Frozenball/pytest-sugar +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 {%- endif %} From 71011c2897faaa3e33081ef95e8903930c91f012 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 1 Feb 2024 19:59:18 +0000 Subject: [PATCH 034/234] Update django-debug-toolbar from 4.2.0 to 4.3.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 4856257df..d757900db 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -43,7 +43,7 @@ pre-commit==3.6.0 # https://github.com/pre-commit/pre-commit # ------------------------------------------------------------------------------ factory-boy==3.3.0 # https://github.com/FactoryBoy/factory_boy -django-debug-toolbar==4.2.0 # https://github.com/jazzband/django-debug-toolbar +django-debug-toolbar==4.3.0 # https://github.com/jazzband/django-debug-toolbar django-extensions==3.2.3 # https://github.com/django-extensions/django-extensions django-coverage-plugin==3.1.0 # https://github.com/nedbat/django_coverage_plugin pytest-django==4.8.0 # https://github.com/pytest-dev/pytest-django From f6db519de086c5a1a4243ce6446e12403246f555 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 4 Feb 2024 07:45:27 +0000 Subject: [PATCH 035/234] Update sphinx-autobuild from 2021.3.14 to 2024.2.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 4856257df..48cee97ee 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -24,7 +24,7 @@ djangorestframework-stubs[compatible-mypy]==3.14.5 # https://github.com/typeddj # Documentation # ------------------------------------------------------------------------------ sphinx==7.2.6 # https://github.com/sphinx-doc/sphinx -sphinx-autobuild==2021.3.14 # https://github.com/GaretJax/sphinx-autobuild +sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ From 0d10182a934a8511a5ddcf6f9fc304bbddc9c822 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 4 Feb 2024 21:41:25 +0000 Subject: [PATCH 036/234] Update psycopg from 3.1.17 to 3.1.18 --- {{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 8a50ecc00..ea1c5a5e3 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -3,7 +3,7 @@ -r base.txt gunicorn==21.2.0 # https://github.com/benoitc/gunicorn -psycopg[c]==3.1.17 # https://github.com/psycopg/psycopg +psycopg[c]==3.1.18 # https://github.com/psycopg/psycopg {%- if cookiecutter.use_whitenoise == 'n' %} Collectfast==2.2.0 # https://github.com/antonagestam/collectfast {%- endif %} From 0cb95819a9895bd4267b95f7c9449de35239574b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 4 Feb 2024 21:41:25 +0000 Subject: [PATCH 037/234] Update psycopg from 3.1.17 to 3.1.18 --- {{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 4856257df..8d031ce4a 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -3,7 +3,7 @@ Werkzeug[watchdog]==3.0.1 # https://github.com/pallets/werkzeug ipdb==0.13.13 # https://github.com/gotcha/ipdb {%- if cookiecutter.use_docker == 'y' %} -psycopg[c]==3.1.17 # https://github.com/psycopg/psycopg +psycopg[c]==3.1.18 # https://github.com/psycopg/psycopg {%- else %} psycopg[binary]==3.1.17 # https://github.com/psycopg/psycopg {%- endif %} From c2d236fc7f8f20fe0f83a8f596a864388b31504a Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 4 Feb 2024 21:41:26 +0000 Subject: [PATCH 038/234] Update psycopg from 3.1.17 to 3.1.18 --- {{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 8d031ce4a..4e800417c 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -5,7 +5,7 @@ ipdb==0.13.13 # https://github.com/gotcha/ipdb {%- if cookiecutter.use_docker == 'y' %} psycopg[c]==3.1.18 # https://github.com/psycopg/psycopg {%- else %} -psycopg[binary]==3.1.17 # https://github.com/psycopg/psycopg +psycopg[binary]==3.1.18 # 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 From 50887868564c8310d6dd022a142908376c9c08f6 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 6 Feb 2024 02:10:18 +0000 Subject: [PATCH 039/234] Release 2024.02.05 --- CHANGELOG.md | 15 +++++++++++++++ setup.py | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6c1cdc3f..f05a4c51d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,21 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.02.05 + + +### Updated + +- Update pytest to 8.0.0 ([#4813](https://github.com/cookiecutter/cookiecutter-django/pull/4813)) + +- Update pytest-sugar to 1.0.0 ([#4828](https://github.com/cookiecutter/cookiecutter-django/pull/4828)) + +- Update sphinx-autobuild to 2024.2.4 ([#4830](https://github.com/cookiecutter/cookiecutter-django/pull/4830)) + +- Update django-debug-toolbar to 4.3.0 ([#4829](https://github.com/cookiecutter/cookiecutter-django/pull/4829)) + +- Update psycopg to 3.1.18 ([#4831](https://github.com/cookiecutter/cookiecutter-django/pull/4831)) + ## 2024.01.31 diff --git a/setup.py b/setup.py index 47c5298ab..554f649a6 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.01.31" +version = "2024.02.05" with open("README.md") as readme_file: long_description = readme_file.read() From 385ef514644a7de108c1f3734b78b524ef1aaf9f Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 7 Feb 2024 04:07:37 -0800 Subject: [PATCH 040/234] Update django to 4.2.10 (#4833) --- {{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 addb67406..3f2d70d7a 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -28,7 +28,7 @@ uvicorn[standard]==0.27.0.post1 # https://github.com/encode/uvicorn # Django # ------------------------------------------------------------------------------ -django==4.2.9 # pyup: < 5.0 # https://www.djangoproject.com/ +django==4.2.10 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.11.2 # https://github.com/joke2k/django-environ django-model-utils==4.3.1 # https://github.com/jazzband/django-model-utils django-allauth==0.60.1 # https://github.com/pennersr/django-allauth From 676234b3a4f280a408430ce79e83d538ffd7b224 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 7 Feb 2024 04:25:45 -0800 Subject: [PATCH 041/234] Update sentry-sdk to 1.40.2 (#4837) Co-authored-by: Bruno Alla --- {{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 ea1c5a5e3..ae9a2dd0e 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==1.40.0 # https://github.com/getsentry/sentry-python +sentry-sdk==1.40.2 # 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 27356353d8edaeeac14264773988d79fc2c7bdfc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 12:26:36 +0000 Subject: [PATCH 042/234] Bump gulp-postcss to 10.0.0 (#4835) Bumps [gulp-postcss](https://github.com/postcss/gulp-postcss) from 9.1.0 to 10.0.0. - [Release notes](https://github.com/postcss/gulp-postcss/releases) - [Commits](https://github.com/postcss/gulp-postcss/compare/9.1.0...10.0.0) --- updated-dependencies: - dependency-name: gulp-postcss dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bruno Alla --- {{cookiecutter.project_slug}}/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/package.json b/{{cookiecutter.project_slug}}/package.json index 958b15ded..efa2136e5 100644 --- a/{{cookiecutter.project_slug}}/package.json +++ b/{{cookiecutter.project_slug}}/package.json @@ -16,7 +16,7 @@ "gulp": "^4.0.2", "gulp-imagemin": "^7.1.0", "gulp-plumber": "^1.2.1", - "gulp-postcss": "^9.0.1", + "gulp-postcss": "^10.0.0", "gulp-rename": "^2.0.0", "gulp-sass": "^5.0.0", "gulp-uglify-es": "^3.0.0", From 52e7b05209fee1faa9c48e03c848481cb29b4b94 Mon Sep 17 00:00:00 2001 From: Jelmer Draaijer Date: Wed, 7 Feb 2024 12:42:29 +0100 Subject: [PATCH 043/234] Generic UserManager --- .../{{cookiecutter.project_slug}}/users/managers.py | 11 ++++++++--- .../{{cookiecutter.project_slug}}/users/models.py | 6 +++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py index 017ab14e7..03ac29548 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py @@ -1,8 +1,13 @@ +from typing import TYPE_CHECKING + from django.contrib.auth.hashers import make_password from django.contrib.auth.models import UserManager as DjangoUserManager +if TYPE_CHECKING: + from {{ cookiecutter.project_slug }}.users.models import User # noqa: F401 -class UserManager(DjangoUserManager): + +class UserManager(DjangoUserManager["User"]): """Custom manager for the User model.""" def _create_user(self, email: str, password: str | None, **extra_fields): @@ -17,12 +22,12 @@ class UserManager(DjangoUserManager): user.save(using=self._db) return user - def create_user(self, email: str, password: str | None = None, **extra_fields): + def create_user(self, email: str, password: str | None = None, **extra_fields): # type: ignore[override] extra_fields.setdefault("is_staff", False) extra_fields.setdefault("is_superuser", False) return self._create_user(email, password, **extra_fields) - def create_superuser(self, email: str, password: str | None = None, **extra_fields): + def create_superuser(self, email: str, password: str | None = None, **extra_fields): # type: ignore[override] extra_fields.setdefault("is_staff", True) extra_fields.setdefault("is_superuser", True) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py index 1e4807510..ccb6b78ae 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py @@ -1,3 +1,7 @@ +{%- if cookiecutter.username_type == "email" %} +from typing import ClassVar +{%- endif %} + from django.contrib.auth.models import AbstractUser from django.db.models import CharField{% if cookiecutter.username_type == "email" %}, EmailField{% endif %} from django.urls import reverse @@ -26,7 +30,7 @@ class User(AbstractUser): USERNAME_FIELD = "email" REQUIRED_FIELDS = [] - objects = UserManager() + objects: ClassVar[UserManager] = UserManager() {%- endif %} def get_absolute_url(self) -> str: From f00d698952fc4f75cbc616d0dea6de2cf3e1f625 Mon Sep 17 00:00:00 2001 From: Jelmer Draaijer Date: Wed, 7 Feb 2024 14:18:14 +0100 Subject: [PATCH 044/234] Install production dependency local in development --- {{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 2a52bc02e..0c1ebca26 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,4 +1,4 @@ --r base.txt +-r production.txt Werkzeug[watchdog]==3.0.1 # https://github.com/pallets/werkzeug ipdb==0.13.13 # https://github.com/gotcha/ipdb From 3cd8d87592c37f8a29287ad10267cc901244ae5e Mon Sep 17 00:00:00 2001 From: Jelmer Draaijer Date: Wed, 7 Feb 2024 14:18:34 +0100 Subject: [PATCH 045/234] Run manage.py check with production settings --- tests/test_docker.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_docker.sh b/tests/test_docker.sh index 8e4055e20..c3cad3b37 100755 --- a/tests/test_docker.sh +++ b/tests/test_docker.sh @@ -30,7 +30,17 @@ docker compose -f local.yml run django python manage.py makemigrations --dry-run docker compose -f local.yml run django python manage.py makemessages --all # Make sure the check doesn't raise any warnings -docker compose -f local.yml run django python manage.py check --fail-level WARNING +docker compose -f 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 \ + -e DJANGO_AWS_ACCESS_KEY_ID=x \ + -e DJANGO_AWS_SECRET_ACCESS_KEY=x \ + -e DJANGO_AWS_STORAGE_BUCKET_NAME=x \ + -e DJANGO_ADMIN_URL=x \ + -e MAILGUN_API_KEY=x \ + -e MAILGUN_DOMAIN=x \ + django python manage.py check --settings=config.settings.production --deploy --database default --fail-level WARNING # Generate the HTML for the documentation docker compose -f local.yml run docs make html From 10376eb1725d1479e0ca7edd12deb46e320a581d Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 7 Feb 2024 13:53:26 +0000 Subject: [PATCH 046/234] Update django-allauth from 0.60.1 to 0.61.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 3f2d70d7a..8658b0b2b 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -31,7 +31,7 @@ uvicorn[standard]==0.27.0.post1 # https://github.com/encode/uvicorn django==4.2.10 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.11.2 # https://github.com/joke2k/django-environ django-model-utils==4.3.1 # https://github.com/jazzband/django-model-utils -django-allauth==0.60.1 # https://github.com/pennersr/django-allauth +django-allauth==0.61.0 # https://github.com/pennersr/django-allauth django-crispy-forms==2.1 # https://github.com/django-crispy-forms/django-crispy-forms crispy-bootstrap5==2023.10 # https://github.com/django-crispy-forms/crispy-bootstrap5 {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} From d5967ed3e9c454c4c88c0fd0473969054e5f0bdb Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 8 Feb 2024 02:09:26 +0000 Subject: [PATCH 047/234] Release 2024.02.07 --- CHANGELOG.md | 19 +++++++++++++++++++ setup.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f05a4c51d..307d72576 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,25 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.02.07 + + +### Changed + +- Extend docker test with deploy check ([#4838](https://github.com/cookiecutter/cookiecutter-django/pull/4838)) + +- Generic UserManager ([#4836](https://github.com/cookiecutter/cookiecutter-django/pull/4836)) + +### Updated + +- Update django-allauth to 0.61.0 ([#4839](https://github.com/cookiecutter/cookiecutter-django/pull/4839)) + +- Bump gulp-postcss to 10.0.0 ([#4835](https://github.com/cookiecutter/cookiecutter-django/pull/4835)) + +- Update sentry-sdk to 1.40.2 ([#4837](https://github.com/cookiecutter/cookiecutter-django/pull/4837)) + +- Update django to 4.2.10 ([#4833](https://github.com/cookiecutter/cookiecutter-django/pull/4833)) + ## 2024.02.05 diff --git a/setup.py b/setup.py index 554f649a6..de9cd1353 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.02.05" +version = "2024.02.07" with open("README.md") as readme_file: long_description = readme_file.read() From 300ccc6b57bd76322afc9e8874ae5c5e77c25da6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Feb 2024 05:10:33 +0000 Subject: [PATCH 048/234] Bump python in /{{cookiecutter.project_slug}}/compose/local/docs Bumps python from 3.11.7-slim-bookworm to 3.11.8-slim-bookworm. --- updated-dependencies: - dependency-name: python dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- {{cookiecutter.project_slug}}/compose/local/docs/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile index 2b68c84b2..87a1b2465 100644 --- a/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile @@ -1,5 +1,5 @@ # define an alias for the specific python version used in this file. -FROM docker.io/python:3.11.7-slim-bookworm as python +FROM docker.io/python:3.11.8-slim-bookworm as python # Python build stage From f2c320527a3e3639c15eda85d7aa0af2a8451ffc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Feb 2024 05:23:12 +0000 Subject: [PATCH 049/234] Bump python in /{{cookiecutter.project_slug}}/compose/local/django Bumps python from 3.11.7-slim-bookworm to 3.11.8-slim-bookworm. --- updated-dependencies: - dependency-name: python dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- {{cookiecutter.project_slug}}/compose/local/django/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index 575a4518a..75d5cbb9b 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -1,5 +1,5 @@ # define an alias for the specific python version used in this file. -FROM docker.io/python:3.11.7-slim-bookworm as python +FROM docker.io/python:3.11.8-slim-bookworm as python # Python build stage FROM docker.io/python as python-build-stage From 908697e5a3777150d4ade52d4c24da475d92f20c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Feb 2024 05:29:46 +0000 Subject: [PATCH 050/234] Bump python in /{{cookiecutter.project_slug}}/compose/production/django Bumps python from 3.11.7-slim-bookworm to 3.11.8-slim-bookworm. --- updated-dependencies: - dependency-name: python dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .../compose/production/django/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 079f6bd78..fb7fec50f 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -25,7 +25,7 @@ RUN npm run build {%- endif %} # define an alias for the specific python version used in this file. -FROM docker.io/python:3.11.7-slim-bookworm as python +FROM docker.io/python:3.11.8-slim-bookworm as python # Python build stage FROM docker.io/python as python-build-stage From 6b90a9e701fffb62650e6baa73c20dfd31872189 Mon Sep 17 00:00:00 2001 From: Jelmer Draaijer Date: Thu, 8 Feb 2024 16:42:07 +0100 Subject: [PATCH 051/234] Implement allauth elements and add body & main block for more override capabilities --- .../templates/account/account_inactive.html | 12 --- .../templates/account/base.html | 14 ---- .../account/base_manage_password.html | 11 +++ .../templates/account/email.html | 80 ------------------- .../templates/account/email_confirm.html | 28 ------- .../templates/account/login.html | 53 ------------ .../templates/account/logout.html | 21 ----- .../templates/account/password_change.html | 19 ----- .../templates/account/password_reset.html | 29 ------- .../account/password_reset_done.html | 18 ----- .../account/password_reset_from_key.html | 37 --------- .../account/password_reset_from_key_done.html | 12 --- .../templates/account/password_set.html | 22 ----- .../templates/account/signup.html | 28 ------- .../templates/account/signup_closed.html | 12 --- .../templates/account/verification_sent.html | 14 ---- .../account/verified_email_required.html | 25 ------ .../templates/allauth/elements/alert.html | 7 ++ .../templates/allauth/elements/badge.html | 6 ++ .../templates/allauth/elements/button.html | 20 +++++ .../templates/allauth/elements/field.html | 67 ++++++++++++++++ .../templates/allauth/elements/fields.html | 3 + .../templates/allauth/elements/panel.html | 19 +++++ .../templates/allauth/elements/table.html | 6 ++ .../templates/allauth/layouts/entrance.html | 18 +++++ .../templates/allauth/layouts/manage.html | 6 ++ .../templates/base.html | 13 ++- 27 files changed, 172 insertions(+), 428 deletions(-) delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/account_inactive.html delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base.html create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base_manage_password.html delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email_confirm.html delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/login.html delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/logout.html delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_change.html delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset.html delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_done.html delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key_done.html delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup.html delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup_closed.html delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verification_sent.html delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verified_email_required.html create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/alert.html create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/badge.html create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/button.html create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/field.html create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/fields.html create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/panel.html create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/table.html create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/manage.html diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/account_inactive.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/account_inactive.html deleted file mode 100644 index a9112cf09..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/account_inactive.html +++ /dev/null @@ -1,12 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Account Inactive" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Account Inactive" %}

-

{% translate "This account is inactive." %}

-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base.html deleted file mode 100644 index 057618257..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base.html +++ /dev/null @@ -1,14 +0,0 @@ -{% raw %}{% extends "base.html" %} - -{% block title %} - {% block head_title %} - {% endblock head_title %} -{% endblock title %} -{% block content %} -
-
- {% block inner %}{% endblock inner %} -
-
-{% endblock content %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base_manage_password.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base_manage_password.html new file mode 100644 index 000000000..515f5244a --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base_manage_password.html @@ -0,0 +1,11 @@ +{% raw %}{% extends "account/base_manage.html" %} + +{% block main %} +
+
+ {% block content %} + {% endblock content %} +
+
+{% endblock main %}{% endraw %} + diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html deleted file mode 100644 index 37770f00c..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html +++ /dev/null @@ -1,80 +0,0 @@ -{% raw %} -{% extends "account/base.html" %} - -{% load i18n %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Account" %} -{% endblock head_title %} -{% block inner %} -

{% translate "E-mail Addresses" %}

- {% if user.emailaddress_set.all %} -

{% translate "The following e-mail addresses are associated with your account:" %}

- - {% else %} -

- {% translate "Warning:" %} {% translate "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %} -

- {% endif %} -

{% translate "Add E-mail Address" %}

-
- {% csrf_token %} - {{ form|crispy }} - -
-{% endblock inner %} -{% block inline_javascript %} - {{ block.super }} - -{% endblock inline_javascript %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email_confirm.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email_confirm.html deleted file mode 100644 index 40ca4a47b..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email_confirm.html +++ /dev/null @@ -1,28 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load account %} - -{% block head_title %} - {% translate "Confirm E-mail Address" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Confirm E-mail Address" %}

- {% if confirmation %} - {% user_display confirmation.email_address.user as user_display %} -

- {% blocktranslate with confirmation.email_address.email as email %}Please confirm that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktranslate %} -

-
- {% csrf_token %} - -
- {% else %} - {% url 'account_email' as email_url %} -

- {% blocktranslate %}This e-mail confirmation link expired or is invalid. Please issue a new e-mail confirmation request.{% endblocktranslate %} -

- {% endif %} -{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/login.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/login.html deleted file mode 100644 index 5737afc06..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/login.html +++ /dev/null @@ -1,53 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load account socialaccount %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Sign In" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Sign In" %}

- {% get_providers as socialaccount_providers %} - {% if socialaccount_providers %} -

- {% translate "Please sign in with one of your existing third party accounts:" %} - {% if ACCOUNT_ALLOW_REGISTRATION %} - {% blocktranslate trimmed %} - Or, sign up - for a {{ site_name }} account and sign in below: - {% endblocktranslate %} - {% endif %} -

-
-
    - {% include "socialaccount/snippets/provider_list.html" with process="login" %} -
- -
- {% include "socialaccount/snippets/login_extra.html" %} - {% else %} - {% if ACCOUNT_ALLOW_REGISTRATION %} -

- {% blocktranslate trimmed %} - If you have not created an account yet, then please - sign up first. - {% endblocktranslate %} -

- {% endif %} - {% endif %} - -{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/logout.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/logout.html deleted file mode 100644 index 43ae9ed38..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/logout.html +++ /dev/null @@ -1,21 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Sign Out" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Sign Out" %}

-

{% translate "Are you sure you want to sign out?" %}

-
- {% csrf_token %} - {% if redirect_field_value %} - - {% endif %} - -
-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_change.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_change.html deleted file mode 100644 index 2e6110d5d..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_change.html +++ /dev/null @@ -1,19 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Change Password" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Change Password" %}

-
- {% csrf_token %} - {{ form|crispy }} - -
-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset.html deleted file mode 100644 index 0c184269a..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset.html +++ /dev/null @@ -1,29 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load account %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Password Reset" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Password Reset" %}

- {% if user.is_authenticated %} - {% include "account/snippets/already_logged_in.html" %} - {% endif %} -

- {% translate "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %} -

-
- {% csrf_token %} - {{ form|crispy }} - -
-

{% blocktranslate %}Please contact us if you have any trouble resetting your password.{% endblocktranslate %}

-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_done.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_done.html deleted file mode 100644 index a596425bb..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_done.html +++ /dev/null @@ -1,18 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load account %} - -{% block head_title %} - {% translate "Password Reset" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Password Reset" %}

- {% if user.is_authenticated %} - {% include "account/snippets/already_logged_in.html" %} - {% endif %} -

- {% blocktranslate %}We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.{% endblocktranslate %} -

-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html deleted file mode 100644 index a958ba089..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html +++ /dev/null @@ -1,37 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Change Password" %} -{% endblock head_title %} -{% block inner %} -

- {% if token_fail %} - {% translate "Bad Token" %} - {% else %} - {% translate "Change Password" %} - {% endif %} -

- {% if token_fail %} - {% url 'account_reset_password' as passwd_reset_url %} -

- {% blocktranslate %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% endblocktranslate %} -

- {% else %} - {% if form %} -
- {% csrf_token %} - {{ form|crispy }} - -
- {% else %} -

{% translate "Your password is now changed." %}

- {% endif %} - {% endif %} -{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key_done.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key_done.html deleted file mode 100644 index ee399b404..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key_done.html +++ /dev/null @@ -1,12 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Change Password" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Change Password" %}

-

{% translate "Your password is now changed." %}

-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html deleted file mode 100644 index 3efc30874..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html +++ /dev/null @@ -1,22 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Set Password" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Set Password" %}

-
- {% csrf_token %} - {{ form|crispy }} - -
-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup.html deleted file mode 100644 index 54150a474..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup.html +++ /dev/null @@ -1,28 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Signup" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Sign Up" %}

-

- {% blocktranslate %}Already have an account? Then please sign in.{% endblocktranslate %} -

- -{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup_closed.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup_closed.html deleted file mode 100644 index b3472ed6d..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup_closed.html +++ /dev/null @@ -1,12 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Sign Up Closed" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Sign Up Closed" %}

-

{% translate "We are sorry, but the sign up is currently closed." %}

-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verification_sent.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verification_sent.html deleted file mode 100644 index d71bbc41a..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verification_sent.html +++ /dev/null @@ -1,14 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Verify Your E-mail Address" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Verify Your E-mail Address" %}

-

- {% blocktranslate %}We have sent an e-mail to you for verification. Follow the link provided to finalize the signup process. Please contact us if you do not receive it within a few minutes.{% endblocktranslate %} -

-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verified_email_required.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verified_email_required.html deleted file mode 100644 index b736581ce..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verified_email_required.html +++ /dev/null @@ -1,25 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Verify Your E-mail Address" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Verify Your E-mail Address" %}

- {% url 'account_email' as email_url %} -

- {% blocktranslate %}This part of the site requires us to verify that -you are who you claim to be. For this purpose, we require that you -verify ownership of your e-mail address. {% endblocktranslate %} -

-

- {% blocktranslate %}We have sent an e-mail to you for -verification. Please click on the link inside this e-mail. Please -contact us if you do not receive it within a few minutes.{% endblocktranslate %} -

-

- {% blocktranslate %}Note: you can still change your e-mail address.{% endblocktranslate %} -

-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/alert.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/alert.html new file mode 100644 index 000000000..090c2cbf6 --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/alert.html @@ -0,0 +1,7 @@ +{% raw %}{% load i18n %} +{% load allauth %} + +
+ {% slot message %} +{% endslot %} +
{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/badge.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/badge.html new file mode 100644 index 000000000..7093939da --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/badge.html @@ -0,0 +1,6 @@ +{% raw %}{% load allauth %} + + + {% slot %} +{% endslot %} +{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/button.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/button.html new file mode 100644 index 000000000..1c0ae4b99 --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/button.html @@ -0,0 +1,20 @@ +{% raw %}{% load allauth %} + +{% comment %} djlint:off {% endcomment %} +<{% if attrs.href %}a href="{{ attrs.href }}"{% else %}button{% endif %} + {% if attrs.form %}form="{{ attrs.form }}"{% endif %} + {% if attrs.id %}id="{{ attrs.id }}"{% endif %} + {% if attrs.name %}name="{{ attrs.name }}"{% endif %} + {% if attrs.type %}type="{{ attrs.type }}"{% endif %} + class="btn +{% if 'success' in attrs.tags %}btn-success +{% elif 'warning' in attrs.tags %}btn-warning +{% elif 'secondary' in attrs.tags %}btn-secondary +{% elif 'danger' in attrs.tags %}btn-danger +{% elif 'primary' in attrs.tags %}btn-primary +{% else %}btn-primary +{% endif %}" +> + {% slot %} + {% endslot %} + {% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/field.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/field.html new file mode 100644 index 000000000..1ed9309a2 --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/field.html @@ -0,0 +1,67 @@ +{% raw %}{% load allauth %} +{% load crispy_forms_tags %} + +{% if attrs.type == "textarea" %} +
+
+ +
+ +
+{% elif attrs.type == "radio" %} +
+
+
+ + +
+
+
+{% else %} +
+ +
+
+ +
+{% endif %} +{% if slots.help_text %} +
{% slot help_text %}
+{% endslot %} +{% endif %}{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/fields.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/fields.html new file mode 100644 index 000000000..6a2f3c2cb --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/fields.html @@ -0,0 +1,3 @@ +{% raw %}{% load crispy_forms_tags %} + +{{ attrs.form|crispy }}{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/panel.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/panel.html new file mode 100644 index 000000000..ce179b587 --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/panel.html @@ -0,0 +1,19 @@ +{% raw %}{% load allauth %} + +
+
+
+

+ {% slot title %} + {% endslot %} +

+ {% slot body %} + {% endslot %} + {% if slots.actions %} +
    + {% for action in slots.actions %}
  • {{ action }}
  • {% endfor %} +
+ {% endif %} +
+
+
{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/table.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/table.html new file mode 100644 index 000000000..7ceb9234d --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/table.html @@ -0,0 +1,6 @@ +{% raw %}{% load allauth %} + + + {% slot %} +{% endslot %} +
{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html new file mode 100644 index 000000000..2632f3c56 --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html @@ -0,0 +1,18 @@ +{% raw %}{% extends "base.html" %} +{% load i18n %} +{% block bodyclass %}bg-light{% endblock bodyclass %} + +{% block css %}{{ block.super }}{% endblock css %} +{% block title %} + {% block head_title %} + {% trans "Sign In" %} + {% endblock head_title %} +{% endblock title %} +{% block body %} +
+
+ {% block content %} + {% endblock content %} +
+
+{% endblock body %}{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/manage.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/manage.html new file mode 100644 index 000000000..b7ff36ba2 --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/manage.html @@ -0,0 +1,6 @@ +{% raw %}{% extends "base.html" %} + +{% block main %} + {% block content %} + {% endblock content %} +{% endblock main %}{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html index 421973e57..ec873c801 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html @@ -111,7 +111,8 @@ {% raw %} {% endblock javascript %} - + + {% block body %}
+ {% endblock body %} {% block modal %} {% endblock modal %} From 44ca412dc1de5489dfdfa3ec5285f18d5b9c7565 Mon Sep 17 00:00:00 2001 From: Jelmer Draaijer Date: Thu, 8 Feb 2024 16:52:16 +0100 Subject: [PATCH 052/234] Enable allauth.mfa for two-factor authentication --- {{cookiecutter.project_slug}}/config/settings/base.py | 1 + {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- .../templates/users/user_detail.html | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 3bf3a73cc..9884814b1 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -83,6 +83,7 @@ THIRD_PARTY_APPS = [ "crispy_bootstrap5", "allauth", "allauth.account", + "allauth.mfa", "allauth.socialaccount", {%- if cookiecutter.use_celery == 'y' %} "django_celery_beat", diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 8658b0b2b..27d303cfe 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -31,7 +31,7 @@ uvicorn[standard]==0.27.0.post1 # https://github.com/encode/uvicorn django==4.2.10 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.11.2 # https://github.com/joke2k/django-environ django-model-utils==4.3.1 # https://github.com/jazzband/django-model-utils -django-allauth==0.61.0 # https://github.com/pennersr/django-allauth +django-allauth[mfa]==0.61.0 # https://github.com/pennersr/django-allauth django-crispy-forms==2.1 # https://github.com/django-crispy-forms/django-crispy-forms crispy-bootstrap5==2023.10 # https://github.com/django-crispy-forms/crispy-bootstrap5 {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_detail.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_detail.html index ab36ba56b..2dc7bfdc7 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_detail.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_detail.html @@ -41,6 +41,9 @@ E-Mail + MFA From d4ff2e4adfe0d2a481ab3d0049bab393a913b659 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 9 Feb 2024 02:09:41 +0000 Subject: [PATCH 053/234] Release 2024.02.08 --- CHANGELOG.md | 11 +++++++++++ setup.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 307d72576..9b4e3c6bd 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.02.08 + + +### Updated + +- Bump python to 3.11.8 in compose/local/docs ([#4840](https://github.com/cookiecutter/cookiecutter-django/pull/4840)) + +- Bump python to 3.11.8 in compose/local/django ([#4841](https://github.com/cookiecutter/cookiecutter-django/pull/4841)) + +- Bump python to 3.11.8 in compose/production/django ([#4842](https://github.com/cookiecutter/cookiecutter-django/pull/4842)) + ## 2024.02.07 diff --git a/setup.py b/setup.py index de9cd1353..efdedee3f 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.02.07" +version = "2024.02.08" with open("README.md") as readme_file: long_description = readme_file.read() From 519d07144c6edb0c83c39b3946d5a9065c93aec7 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 9 Feb 2024 02:46:52 -0800 Subject: [PATCH 054/234] Update python-slugify to 8.0.4 (#4844) --- {{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 8658b0b2b..9a61609d5 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,4 +1,4 @@ -python-slugify==8.0.3 # https://github.com/un33k/python-slugify +python-slugify==8.0.4 # https://github.com/un33k/python-slugify Pillow==10.2.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} {%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} From 1e09d20ffcad44696fc7ddadd169afc1e65755e4 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 9 Feb 2024 02:48:31 -0800 Subject: [PATCH 055/234] Update django-allauth to 0.61.1 (#4846) --- {{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 9a61609d5..70588e23e 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -31,7 +31,7 @@ uvicorn[standard]==0.27.0.post1 # https://github.com/encode/uvicorn django==4.2.10 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.11.2 # https://github.com/joke2k/django-environ django-model-utils==4.3.1 # https://github.com/jazzband/django-model-utils -django-allauth==0.61.0 # https://github.com/pennersr/django-allauth +django-allauth==0.61.1 # https://github.com/pennersr/django-allauth django-crispy-forms==2.1 # https://github.com/django-crispy-forms/django-crispy-forms crispy-bootstrap5==2023.10 # https://github.com/django-crispy-forms/crispy-bootstrap5 {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} From 474b82b5d3fa67accc3f927e7b1549eadbd2773f Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 9 Feb 2024 04:49:08 -0800 Subject: [PATCH 056/234] Update sentry-sdk to 1.40.3 (#4847) --- {{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 ae9a2dd0e..b6e793e11 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==1.40.2 # https://github.com/getsentry/sentry-python +sentry-sdk==1.40.3 # 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 9b0bc1cc5ccc9935be40bd472cd460e30707d1ae Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 10 Feb 2024 02:08:31 +0000 Subject: [PATCH 057/234] Release 2024.02.09 --- CHANGELOG.md | 11 +++++++++++ setup.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b4e3c6bd..c5e20748a 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.02.09 + + +### Updated + +- Update sentry-sdk to 1.40.3 ([#4847](https://github.com/cookiecutter/cookiecutter-django/pull/4847)) + +- Update django-allauth to 0.61.1 ([#4846](https://github.com/cookiecutter/cookiecutter-django/pull/4846)) + +- Update python-slugify to 8.0.4 ([#4844](https://github.com/cookiecutter/cookiecutter-django/pull/4844)) + ## 2024.02.08 diff --git a/setup.py b/setup.py index efdedee3f..b5182fce7 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.02.08" +version = "2024.02.09" with open("README.md") as readme_file: long_description = readme_file.read() From 128310262964fc4ff0147d34c6528dea6fb067ef Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 10 Feb 2024 13:43:55 +0000 Subject: [PATCH 058/234] Update uvicorn from 0.27.0.post1 to 0.27.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 70588e23e..442357fc4 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -23,7 +23,7 @@ flower==2.0.1 # https://github.com/mher/flower {%- endif %} {%- endif %} {%- if cookiecutter.use_async == 'y' %} -uvicorn[standard]==0.27.0.post1 # https://github.com/encode/uvicorn +uvicorn[standard]==0.27.1 # https://github.com/encode/uvicorn {%- endif %} # Django From e95c2733dd87cd48d10416230cd55fb4a138f658 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 09:24:54 +0000 Subject: [PATCH 059/234] Auto-update pre-commit hooks (#4852) 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 12a1f5e81..d32ac6b84 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.15.0' + rev: '1.16.0' hooks: - id: django-upgrade args: ['--target-version', '4.2'] From 1086d19af9f10b834cd9196a0b58642e064df8dc Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 12 Feb 2024 01:25:06 -0800 Subject: [PATCH 060/234] Update django-upgrade to 1.16.0 (#4851) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b9ddeac0d..471a5d677 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,7 @@ binaryornot==0.4.4 black==24.1.1 isort==5.13.2 flake8==7.0.0 -django-upgrade==1.15.0 +django-upgrade==1.16.0 djlint==1.34.1 pre-commit==3.6.0 From 6ac86a5b57a2a3dbc6f4f9c067a5c914e62993eb Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 12 Feb 2024 01:25:23 -0800 Subject: [PATCH 061/234] Update pre-commit to 3.6.1 (#4849) * Update pre-commit from 3.6.0 to 3.6.1 * Update pre-commit from 3.6.0 to 3.6.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 471a5d677..18ae8f05e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ isort==5.13.2 flake8==7.0.0 django-upgrade==1.16.0 djlint==1.34.1 -pre-commit==3.6.0 +pre-commit==3.6.1 # Testing # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 0c1ebca26..ef26dcc8c 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -37,7 +37,7 @@ pylint-django==2.5.5 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} -pre-commit==3.6.0 # https://github.com/pre-commit/pre-commit +pre-commit==3.6.1 # https://github.com/pre-commit/pre-commit # Django # ------------------------------------------------------------------------------ From 576bb1d452d225b7c93204d93582e94cc58fabb8 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 12 Feb 2024 01:25:47 -0800 Subject: [PATCH 062/234] Update django-model-utils to 4.4.0 (#4850) --- {{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 70588e23e..e260bc922 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -30,7 +30,7 @@ uvicorn[standard]==0.27.0.post1 # https://github.com/encode/uvicorn # ------------------------------------------------------------------------------ django==4.2.10 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.11.2 # https://github.com/joke2k/django-environ -django-model-utils==4.3.1 # https://github.com/jazzband/django-model-utils +django-model-utils==4.4.0 # https://github.com/jazzband/django-model-utils django-allauth==0.61.1 # https://github.com/pennersr/django-allauth django-crispy-forms==2.1 # https://github.com/django-crispy-forms/django-crispy-forms crispy-bootstrap5==2023.10 # https://github.com/django-crispy-forms/crispy-bootstrap5 From f12ac669f3d1a48d03363819f74e6d29ece0575c Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 13 Feb 2024 02:10:21 +0000 Subject: [PATCH 063/234] Release 2024.02.12 --- CHANGELOG.md | 13 +++++++++++++ setup.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5e20748a..1ee7a5895 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.02.12 + + +### Updated + +- Update django-model-utils to 4.4.0 ([#4850](https://github.com/cookiecutter/cookiecutter-django/pull/4850)) + +- Update pre-commit to 3.6.1 ([#4849](https://github.com/cookiecutter/cookiecutter-django/pull/4849)) + +- Update django-upgrade to 1.16.0 ([#4851](https://github.com/cookiecutter/cookiecutter-django/pull/4851)) + +- Auto-update pre-commit hooks ([#4852](https://github.com/cookiecutter/cookiecutter-django/pull/4852)) + ## 2024.02.09 diff --git a/setup.py b/setup.py index b5182fce7..7c129824d 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.02.09" +version = "2024.02.12" with open("README.md") as readme_file: long_description = readme_file.read() From 2e129bd65b9d59270de6351f3478b320f5294664 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 13 Feb 2024 02:25:10 -0800 Subject: [PATCH 064/234] Update black to 24.2.0 (#4853) * Update black from 24.1.1 to 24.2.0 * Update black from 24.1.1 to 24.2.0 --- 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 18ae8f05e..a84612d0f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -black==24.1.1 +black==24.2.0 isort==5.13.2 flake8==7.0.0 django-upgrade==1.16.0 diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index ef26dcc8c..cad007f47 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -31,7 +31,7 @@ sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild flake8==7.0.0 # https://github.com/PyCQA/flake8 flake8-isort==6.1.1 # https://github.com/gforcada/flake8-isort coverage==7.4.1 # https://github.com/nedbat/coveragepy -black==24.1.1 # https://github.com/psf/black +black==24.2.0 # https://github.com/psf/black djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pylint-django==2.5.5 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} From 07376d8a7f3f60f9dc405466dfa83646bf615d10 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 10:25:25 +0000 Subject: [PATCH 065/234] Auto-update pre-commit hooks (#4855) Co-authored-by: browniebroke <861044+browniebroke@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- {{cookiecutter.project_slug}}/.pre-commit-config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index baafb694f..7daf6ac71 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: exclude: hooks/ - repo: https://github.com/psf/black - rev: 24.1.1 + rev: 24.2.0 hooks: - id: black diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index d32ac6b84..466cfeced 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -40,7 +40,7 @@ repos: args: [--py311-plus] - repo: https://github.com/psf/black - rev: 24.1.1 + rev: 24.2.0 hooks: - id: black From dd841c64780cdeb25f6ab89bdd47fa6c528f1edb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 10:28:24 +0000 Subject: [PATCH 066/234] Bump traefik to 2.11.0 (#4857) Bumps traefik from 2.10.7 to 2.11.0. --- updated-dependencies: - dependency-name: traefik dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../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 c32b15873..ea918e911 100644 --- a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/traefik:2.10.7 +FROM docker.io/traefik:2.11.0 RUN mkdir -p /etc/traefik/acme \ && touch /etc/traefik/acme/acme.json \ && chmod 600 /etc/traefik/acme/acme.json From 6ba6104f09d4c4c9d56eb6b460e17748115ececb Mon Sep 17 00:00:00 2001 From: Jelmer Draaijer Date: Tue, 6 Feb 2024 19:56:31 +0100 Subject: [PATCH 067/234] Ruff as formatter & linter --- docs/linters.rst | 48 ++---- requirements.txt | 4 +- .../.devcontainer/devcontainer.json | 13 +- .../.pre-commit-config.yaml | 27 +-- {{cookiecutter.project_slug}}/.travis.yml | 8 +- {{cookiecutter.project_slug}}/README.md | 2 +- {{cookiecutter.project_slug}}/pyproject.toml | 162 ++++++++++++------ .../requirements/local.txt | 8 +- {{cookiecutter.project_slug}}/setup.cfg | 11 -- .../users/tests/test_admin.py | 2 +- 10 files changed, 145 insertions(+), 140 deletions(-) delete mode 100644 {{cookiecutter.project_slug}}/setup.cfg diff --git a/docs/linters.rst b/docs/linters.rst index a4f60cc8d..1fc44f30b 100644 --- a/docs/linters.rst +++ b/docs/linters.rst @@ -4,40 +4,30 @@ Linters .. index:: linters -flake8 +ruff ------ -To run flake8: :: +Ruff is a Python linter and code formatter, written in Rust. +It is a aggregation of flake8, pylint, pyupgrade and many more. - $ flake8 +Ruff comes with a linter (``ruff check``) and a formatter (``ruff format``). +The linter is a wrapper around flake8, pylint, and other linters, +and the formatter is a wrapper around black, isort, and other formatters. -The config for flake8 is located in setup.cfg. It specifies: +To run ruff without modifying your files: :: -* Set max line length to 120 chars -* Exclude ``.tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules`` + $ ruff format --diff . + $ ruff check . -pylint ------- +Ruff is capable of fixing most of the problems it encounters. +Be sure you commit first before running `ruff` so you can restore to a savepoint (and amend afterwards to prevent a double commit. : :: -To run pylint: :: + $ ruff format . + $ ruff check --fix . + # be careful with the --unsafe-fixes option, it can break your code + $ ruff check --fix --unsafe-fixes . - $ pylint - -The config for pylint is located in .pylintrc. It specifies: - -* Use the pylint_django plugin. If using Celery, also use pylint_celery. -* Set max line length to 120 chars -* Disable linting messages for missing docstring and invalid name -* max-parents=13 - -pycodestyle ------------ - -This is included in flake8's checks, but you can also run it separately to see a more detailed report: :: - - $ pycodestyle - -The config for pycodestyle is located in setup.cfg. It specifies: - -* Set max line length to 120 chars -* Exclude ``.tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules`` +The config for ruff is located in pyproject.toml. +On of the most important option is `tool.ruff.lint.select`. +`select` determines which linters are run. In example, `DJ `_ refers to flake8-django. +For a full list of available linters, see `https://docs.astral.sh/ruff/rules/ `_ diff --git a/requirements.txt b/requirements.txt index a84612d0f..3de15dc6f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,9 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -black==24.2.0 -isort==5.13.2 -flake8==7.0.0 +ruff==0.2.1 django-upgrade==1.16.0 djlint==1.34.1 pre-commit==3.6.1 diff --git a/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json b/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json index c4158dc10..7fcd62872 100644 --- a/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json +++ b/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json @@ -37,22 +37,11 @@ "editor.codeActionsOnSave": { "source.organizeImports": true }, - // Uncomment when fixed - // https://github.com/microsoft/vscode-remote-release/issues/8474 - // "editor.defaultFormatter": "ms-python.black-formatter", - "formatting.blackPath": "/usr/local/bin/black", - "formatting.provider": "black", + "editor.defaultFormatter": "charliermarsh.ruff", "languageServer": "Pylance", - // "linting.banditPath": "/usr/local/py-utils/bin/bandit", "linting.enabled": true, - "linting.flake8Enabled": true, - "linting.flake8Path": "/usr/local/bin/flake8", "linting.mypyEnabled": true, "linting.mypyPath": "/usr/local/bin/mypy", - "linting.pycodestylePath": "/usr/local/bin/pycodestyle", - // "linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", - "linting.pylintEnabled": true, - "linting.pylintPath": "/usr/local/bin/pylint" } }, // https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_vs-code-specific-properties diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 466cfeced..7c9565e19 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -33,26 +33,15 @@ repos: - id: django-upgrade args: ['--target-version', '4.2'] - - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + # Run the Ruff linter. + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.2.1 hooks: - - id: pyupgrade - args: [--py311-plus] - - - repo: https://github.com/psf/black - rev: 24.2.0 - hooks: - - id: black - - - repo: https://github.com/PyCQA/isort - rev: 5.13.2 - hooks: - - id: isort - - - repo: https://github.com/PyCQA/flake8 - rev: 7.0.0 - hooks: - - id: flake8 + # Linter + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + # Formatter + - id: ruff-format - repo: https://github.com/Riverside-Healthcare/djLint rev: v1.34.1 diff --git a/{{cookiecutter.project_slug}}/.travis.yml b/{{cookiecutter.project_slug}}/.travis.yml index cd703d3ad..78709191a 100644 --- a/{{cookiecutter.project_slug}}/.travis.yml +++ b/{{cookiecutter.project_slug}}/.travis.yml @@ -10,9 +10,9 @@ jobs: include: - name: "Linter" before_script: - - pip install -q flake8 + - pip install -q ruff script: - - "flake8" + - ruff check . - name: "Django Test" {%- if cookiecutter.use_docker == 'y' %} @@ -24,7 +24,7 @@ jobs: - docker compose -f local.yml run --rm django python manage.py migrate - docker compose -f local.yml up -d script: - - "docker compose -f local.yml run django pytest" + - docker compose -f local.yml run django pytest after_failure: - docker compose -f local.yml logs {%- else %} @@ -41,5 +41,5 @@ jobs: install: - pip install -r requirements/local.txt script: - - "pytest" + - pytest {%- endif %} diff --git a/{{cookiecutter.project_slug}}/README.md b/{{cookiecutter.project_slug}}/README.md index ccf245a2f..cb7576892 100644 --- a/{{cookiecutter.project_slug}}/README.md +++ b/{{cookiecutter.project_slug}}/README.md @@ -3,7 +3,7 @@ {{ cookiecutter.description }} [![Built with Cookiecutter Django](https://img.shields.io/badge/built%20with-Cookiecutter%20Django-ff69b4.svg?logo=cookiecutter)](https://github.com/cookiecutter/cookiecutter-django/) -[![Black code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black) +[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) {%- if cookiecutter.open_source_license != "Not open source" %} diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index 7e4c9aa9c..a056c71c3 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -16,25 +16,6 @@ include = ["{{cookiecutter.project_slug}}/**"] omit = ["*/migrations/*", "*/tests/*"] plugins = ["django_coverage_plugin"] - -# ==== black ==== -[tool.black] -line-length = 119 -target-version = ['py311'] - - -# ==== isort ==== -[tool.isort] -profile = "black" -line_length = 119 -known_first_party = [ - "{{cookiecutter.project_slug}}", - "config", -] -skip = ["venv/"] -skip_glob = ["**/migrations/*.py"] - - # ==== mypy ==== [tool.mypy] python_version = "3.11" @@ -58,40 +39,6 @@ ignore_errors = true [tool.django-stubs] django_settings_module = "config.settings.test" - -# ==== PyLint ==== -[tool.pylint.MASTER] -load-plugins = [ - "pylint_django", -{%- if cookiecutter.use_celery == "y" %} - "pylint_celery", -{%- endif %} -] -django-settings-module = "config.settings.local" - -[tool.pylint.FORMAT] -max-line-length = 119 - -[tool.pylint."MESSAGES CONTROL"] -disable = [ - "missing-docstring", - "invalid-name", -] - -[tool.pylint.DESIGN] -max-parents = 13 - -[tool.pylint.TYPECHECK] -generated-members = [ - "REQUEST", - "acl_users", - "aq_parent", - "[a-zA-Z]+_set{1,2}", - "save", - "delete", -] - - # ==== djLint ==== [tool.djlint] blank_line_after_tag = "load,extends" @@ -110,3 +57,112 @@ indent_size = 2 [tool.djlint.js] indent_size = 2 + +[tool.ruff] +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".mypy_cache", + ".nox", + ".pants.d", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "venv", + "*/migrations/*.py", + "staticfiles/*" +] +# Same as Django: https://github.com/cookiecutter/cookiecutter-django/issues/4792. +line-length = 88 +indent-width = 4 +target-version = "py311" + +[tool.ruff.lint] +select = [ + "F", + "E", + "W", + "C90", + "I", + "N", + "UP", + "YTT", + # "ANN", # flake8-annotations: we should support this in the future but 100+ errors atm + "ASYNC", + "S", + "BLE", + "FBT", + "B", + "A", + "COM", + "C4", + "DTZ", + "T10", + "DJ", + "EM", + "EXE", + "FA", + 'ISC', + "ICN", + "G", + 'INP', + 'PIE', + "T20", + 'PYI', + 'PT', + "Q", + "RSE", + "RET", + "SLF", + "SLOT", + "SIM", + "TID", + "TCH", + "INT", + # "ARG", # Unused function argument + "PTH", + "ERA", + "PD", + "PGH", + "PL", + "TRY", + "FLY", + # "NPY", + # "AIR", + "PERF", + # "FURB", + # "LOG", + "RUF" +] +ignore = [ + "S101", # Use of assert detected https://docs.astral.sh/ruff/rules/assert/ + "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` + "SIM102" # sometimes it's better to nest +] +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[tool.ruff.format] +quote-style = "double" +indent-style = "space" +skip-magic-trailing-comma = false +line-ending = "auto" + +[tool.ruff.lint.isort] +force-single-line = true diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index cad007f47..da0e04943 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -28,15 +28,9 @@ sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ -flake8==7.0.0 # https://github.com/PyCQA/flake8 -flake8-isort==6.1.1 # https://github.com/gforcada/flake8-isort +ruff==0.2.1 coverage==7.4.1 # https://github.com/nedbat/coveragepy -black==24.2.0 # https://github.com/psf/black djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint -pylint-django==2.5.5 # https://github.com/PyCQA/pylint-django -{%- if cookiecutter.use_celery == 'y' %} -pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery -{%- endif %} pre-commit==3.6.1 # https://github.com/pre-commit/pre-commit # Django diff --git a/{{cookiecutter.project_slug}}/setup.cfg b/{{cookiecutter.project_slug}}/setup.cfg deleted file mode 100644 index 2412f1746..000000000 --- a/{{cookiecutter.project_slug}}/setup.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# flake8 and pycodestyle don't support pyproject.toml -# https://github.com/PyCQA/flake8/issues/234 -# https://github.com/PyCQA/pycodestyle/issues/813 -[flake8] -max-line-length = 119 -exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules,venv,.venv -extend-ignore = E203 - -[pycodestyle] -max-line-length = 119 -exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules,venv,.venv 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 75917ab34..095b2cbbf 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 @@ -58,7 +58,7 @@ class TestUserAdmin: def force_allauth(self, settings): settings.DJANGO_ADMIN_FORCE_ALLAUTH = True # Reload the admin module to apply the setting change - import {{ cookiecutter.project_slug }}.users.admin as users_admin # pylint: disable=import-outside-toplevel + import {{ cookiecutter.project_slug }}.users.admin as users_admin try: reload(users_admin) From 0fc4ea6165ad98a99648e815ef615fbf85482260 Mon Sep 17 00:00:00 2001 From: Jelmer Draaijer Date: Tue, 13 Feb 2024 11:57:53 +0100 Subject: [PATCH 068/234] Apply ruff to codebase --- tests/test_cookiecutter_generation.py | 19 +++++------ .../config/api_router.py | 8 ++--- {{cookiecutter.project_slug}}/config/asgi.py | 6 ++-- .../config/settings/base.py | 11 +++--- .../config/settings/local.py | 26 +++++++++----- .../config/settings/production.py | 34 +++++++++++++------ .../config/settings/test.py | 5 +-- {{cookiecutter.project_slug}}/config/urls.py | 18 +++++++--- {{cookiecutter.project_slug}}/config/wsgi.py | 1 + {{cookiecutter.project_slug}}/docs/conf.py | 1 + {{cookiecutter.project_slug}}/manage.py | 3 +- .../merge_production_dotenvs_in_dotenv.py | 1 + .../tests/__init__.py | 0 .../{{cookiecutter.project_slug}}/__init__.py | 5 ++- .../{{cookiecutter.project_slug}}/conftest.py | 4 +-- .../contrib/sites/migrations/0001_initial.py | 5 +-- .../migrations/0002_alter_domain_unique.py | 3 +- .../0003_set_site_domain_and_name.py | 2 +- .../users/adapters.py | 16 +++++++-- .../users/admin.py | 6 ++-- .../users/api/serializers.py | 1 - .../users/api/views.py | 4 ++- .../users/apps.py | 6 ++-- .../users/managers.py | 9 +++-- .../users/migrations/0001_initial.py | 13 +++---- .../users/models.py | 13 ++++--- .../users/tests/factories.py | 5 +-- .../users/tests/test_admin.py | 24 ++++++------- .../users/tests/test_drf_urls.py | 12 +++++-- .../users/tests/test_drf_views.py | 4 +-- .../users/tests/test_forms.py | 2 +- .../users/tests/test_managers.py | 10 +++--- .../users/tests/test_swagger.py | 10 +++--- .../users/tests/test_tasks.py | 5 +-- .../users/tests/test_urls.py | 8 +++-- .../users/tests/test_views.py | 17 +++++----- .../users/urls.py | 8 ++--- .../users/views.py | 7 ++-- 38 files changed, 204 insertions(+), 128 deletions(-) create mode 100644 {{cookiecutter.project_slug}}/tests/__init__.py diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index 31d006bed..b744a986c 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -180,28 +180,25 @@ def test_project_generation(cookies, context, context_override): @pytest.mark.parametrize("context_override", SUPPORTED_COMBINATIONS, ids=_fixture_id) -def test_flake8_passes(cookies, context_override): - """Generated project should pass flake8.""" +def test_ruff_check_passes(cookies, context_override): + """Generated project should pass ruff check.""" result = cookies.bake(extra_context=context_override) try: - sh.flake8(_cwd=str(result.project_path)) + sh.ruff("check", ".", _cwd=str(result.project_path)) except sh.ErrorReturnCode as e: pytest.fail(e.stdout.decode()) @auto_fixable @pytest.mark.parametrize("context_override", SUPPORTED_COMBINATIONS, ids=_fixture_id) -def test_black_passes(cookies, context_override): - """Check whether generated project passes black style.""" +def test_ruff_format_passes(cookies, context_override): + """Check whether generated project passes ruff format.""" result = cookies.bake(extra_context=context_override) try: - sh.black( - "--check", - "--diff", - "--exclude", - "migrations", + sh.ruff( + "format", ".", _cwd=str(result.project_path), ) @@ -287,7 +284,7 @@ def test_travis_invokes_pytest(cookies, context, use_docker, expected_test_scrip with open(f"{result.project_path}/.travis.yml") as travis_yml: try: yml = yaml.safe_load(travis_yml)["jobs"]["include"] - assert yml[0]["script"] == ["flake8"] + assert yml[0]["script"] == ["ruff check ."] assert yml[1]["script"] == [expected_test_script] except yaml.YAMLError as e: pytest.fail(str(e)) diff --git a/{{cookiecutter.project_slug}}/config/api_router.py b/{{cookiecutter.project_slug}}/config/api_router.py index 743069b2c..d4de098fc 100644 --- a/{{cookiecutter.project_slug}}/config/api_router.py +++ b/{{cookiecutter.project_slug}}/config/api_router.py @@ -1,12 +1,10 @@ from django.conf import settings -from rest_framework.routers import DefaultRouter, SimpleRouter +from rest_framework.routers import DefaultRouter +from rest_framework.routers import SimpleRouter from {{ cookiecutter.project_slug }}.users.api.views import UserViewSet -if settings.DEBUG: - router = DefaultRouter() -else: - router = SimpleRouter() +router = DefaultRouter() if settings.DEBUG else SimpleRouter() router.register("users", UserViewSet) diff --git a/{{cookiecutter.project_slug}}/config/asgi.py b/{{cookiecutter.project_slug}}/config/asgi.py index c391bf87b..edfffbbc5 100644 --- a/{{cookiecutter.project_slug}}/config/asgi.py +++ b/{{cookiecutter.project_slug}}/config/asgi.py @@ -1,3 +1,4 @@ +# ruff: noqa """ ASGI config for {{ cookiecutter.project_name }} project. @@ -29,7 +30,7 @@ django_application = get_asgi_application() # application = HelloWorldApplication(application) # Import websocket application here, so apps from django_application are loaded first -from config.websocket import websocket_application # noqa isort:skip +from config.websocket import websocket_application async def application(scope, receive, send): @@ -38,4 +39,5 @@ async def application(scope, receive, send): elif scope["type"] == "websocket": await websocket_application(scope, receive, send) else: - raise NotImplementedError(f"Unknown scope type {scope['type']}") + msg = f"Unknown scope type {scope['type']}" + raise NotImplementedError(msg) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 3bf3a73cc..55a064e74 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -1,3 +1,4 @@ +# ruff: noqa: ERA001, E501 """Base settings to build other settings files upon.""" from pathlib import Path @@ -136,7 +137,9 @@ PASSWORD_HASHERS = [ ] # https://docs.djangoproject.com/en/dev/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ - {"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"}, + { + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", + }, {"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"}, {"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"}, {"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"}, @@ -209,7 +212,7 @@ TEMPLATES = [ "{{cookiecutter.project_slug}}.users.context_processors.allauth_settings", ], }, - } + }, ] # https://docs.djangoproject.com/en/dev/ref/settings/#form-renderer @@ -273,7 +276,7 @@ LOGGING = { "level": "DEBUG", "class": "logging.StreamHandler", "formatter": "verbose", - } + }, }, "root": {"level": "INFO", "handlers": ["console"]}, } @@ -379,7 +382,7 @@ WEBPACK_LOADER = { "STATS_FILE": BASE_DIR / "webpack-stats.json", "POLL_INTERVAL": 0.1, "IGNORE": [r".+\.hot-update.js", r".+\.map"], - } + }, } {%- endif %} diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py index 0304d6cd4..f1edb514b 100644 --- a/{{cookiecutter.project_slug}}/config/settings/local.py +++ b/{{cookiecutter.project_slug}}/config/settings/local.py @@ -1,4 +1,10 @@ -from .base import * # noqa +# ruff: noqa: E501 +from .base import * # noqa: F403 +from .base import INSTALLED_APPS +from .base import MIDDLEWARE +{%- if cookiecutter.frontend_pipeline == 'Webpack' %} +from .base import WEBPACK_LOADER +{%- endif %} from .base import env # GENERAL @@ -11,7 +17,7 @@ SECRET_KEY = env( default="!!!SET DJANGO_SECRET_KEY!!!", ) # https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts -ALLOWED_HOSTS = ["localhost", "0.0.0.0", "127.0.0.1"] +ALLOWED_HOSTS = ["localhost", "0.0.0.0", "127.0.0.1"] # noqa: S104 # CACHES # ------------------------------------------------------------------------------ @@ -20,7 +26,7 @@ CACHES = { "default": { "BACKEND": "django.core.cache.backends.locmem.LocMemCache", "LOCATION": "", - } + }, } # EMAIL @@ -37,7 +43,9 @@ EMAIL_HOST = "localhost" EMAIL_PORT = 1025 {%- else -%} # https://docs.djangoproject.com/en/dev/ref/settings/#email-backend -EMAIL_BACKEND = env("DJANGO_EMAIL_BACKEND", default="django.core.mail.backends.console.EmailBackend") +EMAIL_BACKEND = env( + "DJANGO_EMAIL_BACKEND", default="django.core.mail.backends.console.EmailBackend", +) {%- endif %} {%- if cookiecutter.use_whitenoise == 'y' %} @@ -45,15 +53,15 @@ EMAIL_BACKEND = env("DJANGO_EMAIL_BACKEND", default="django.core.mail.backends.c # WhiteNoise # ------------------------------------------------------------------------------ # http://whitenoise.evans.io/en/latest/django.html#using-whitenoise-in-development -INSTALLED_APPS = ["whitenoise.runserver_nostatic"] + INSTALLED_APPS # noqa: F405 +INSTALLED_APPS = ["whitenoise.runserver_nostatic", *INSTALLED_APPS] {% endif %} # django-debug-toolbar # ------------------------------------------------------------------------------ # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#prerequisites -INSTALLED_APPS += ["debug_toolbar"] # noqa: F405 +INSTALLED_APPS += ["debug_toolbar"] # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#middleware -MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"] # noqa: F405 +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"], @@ -80,7 +88,7 @@ if env("USE_DOCKER") == "yes": # django-extensions # ------------------------------------------------------------------------------ # https://django-extensions.readthedocs.io/en/latest/installation_instructions.html#configuration -INSTALLED_APPS += ["django_extensions"] # noqa: F405 +INSTALLED_APPS += ["django_extensions"] {% if cookiecutter.use_celery == 'y' -%} # Celery @@ -96,7 +104,7 @@ CELERY_TASK_EAGER_PROPAGATES = True {%- if cookiecutter.frontend_pipeline == 'Webpack' %} # django-webpack-loader # ------------------------------------------------------------------------------ -WEBPACK_LOADER["DEFAULT"]["CACHE"] = not DEBUG # noqa: F405 +WEBPACK_LOADER["DEFAULT"]["CACHE"] = not DEBUG {%- endif %} # Your stuff... diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 7f6293571..0cebe1d96 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -1,3 +1,4 @@ +# ruff: noqa: E501 {% if cookiecutter.use_sentry == 'y' -%} import logging @@ -12,7 +13,12 @@ from sentry_sdk.integrations.logging import LoggingIntegration from sentry_sdk.integrations.redis import RedisIntegration {% endif -%} -from .base import * # noqa +from .base import * # noqa: F403 +from .base import DATABASES +from .base import INSTALLED_APPS +{%- if cookiecutter.use_drf == "y" %} +from .base import SPECTACULAR_SETTINGS +{%- endif %} from .base import env # GENERAL @@ -24,7 +30,7 @@ ALLOWED_HOSTS = env.list("DJANGO_ALLOWED_HOSTS", default=["{{ cookiecutter.domai # DATABASES # ------------------------------------------------------------------------------ -DATABASES["default"]["CONN_MAX_AGE"] = env.int("CONN_MAX_AGE", default=60) # noqa: F405 +DATABASES["default"]["CONN_MAX_AGE"] = env.int("CONN_MAX_AGE", default=60) # CACHES # ------------------------------------------------------------------------------ @@ -38,7 +44,7 @@ CACHES = { # https://github.com/jazzband/django-redis#memcached-exceptions-behavior "IGNORE_EXCEPTIONS": True, }, - } + }, } # SECURITY @@ -56,17 +62,23 @@ CSRF_COOKIE_SECURE = True # TODO: set this to 60 seconds first and then to 518400 once you prove the former works SECURE_HSTS_SECONDS = 60 # https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-include-subdomains -SECURE_HSTS_INCLUDE_SUBDOMAINS = env.bool("DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS", default=True) +SECURE_HSTS_INCLUDE_SUBDOMAINS = env.bool( + "DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS", + default=True, +) # https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-preload SECURE_HSTS_PRELOAD = env.bool("DJANGO_SECURE_HSTS_PRELOAD", default=True) # https://docs.djangoproject.com/en/dev/ref/middleware/#x-content-type-options-nosniff -SECURE_CONTENT_TYPE_NOSNIFF = env.bool("DJANGO_SECURE_CONTENT_TYPE_NOSNIFF", default=True) +SECURE_CONTENT_TYPE_NOSNIFF = env.bool( + "DJANGO_SECURE_CONTENT_TYPE_NOSNIFF", + default=True, +) {% if cookiecutter.cloud_provider != 'None' -%} # STORAGES # ------------------------------------------------------------------------------ # https://django-storages.readthedocs.io/en/latest/#installation -INSTALLED_APPS += ["storages"] # noqa: F405 +INSTALLED_APPS += ["storages"] {%- endif -%} {% if cookiecutter.cloud_provider == 'AWS' %} # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings @@ -197,7 +209,7 @@ ADMIN_URL = env("DJANGO_ADMIN_URL") # Anymail # ------------------------------------------------------------------------------ # https://anymail.readthedocs.io/en/stable/installation/#installing-anymail -INSTALLED_APPS += ["anymail"] # noqa: F405 +INSTALLED_APPS += ["anymail"] # https://docs.djangoproject.com/en/dev/ref/settings/#email-backend # https://anymail.readthedocs.io/en/stable/installation/#anymail-settings-reference {%- if cookiecutter.mail_service == 'Mailgun' %} @@ -273,7 +285,7 @@ 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' %} # noqa: F405{% endif %} +COMPRESS_URL = STATIC_URL{% if cookiecutter.use_whitenoise == 'y' or cookiecutter.cloud_provider == 'None' %}{% 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 @@ -291,7 +303,7 @@ COMPRESS_FILTERS = { # Collectfast # ------------------------------------------------------------------------------ # https://github.com/antonagestam/collectfast#installation -INSTALLED_APPS = ["collectfast"] + INSTALLED_APPS # noqa: F405 +INSTALLED_APPS = ["collectfast", *INSTALLED_APPS] {% endif %} # LOGGING # ------------------------------------------------------------------------------ @@ -351,7 +363,7 @@ LOGGING = { "level": "DEBUG", "class": "logging.StreamHandler", "formatter": "verbose", - } + }, }, "root": {"level": "INFO", "handlers": ["console"]}, "loggers": { @@ -403,7 +415,7 @@ sentry_sdk.init( # django-rest-framework # ------------------------------------------------------------------------------- # Tools that generate code samples can use SERVERS to point to the correct domain -SPECTACULAR_SETTINGS["SERVERS"] = [ # noqa: F405 +SPECTACULAR_SETTINGS["SERVERS"] = [ {"url": "https://{{ cookiecutter.domain_name }}", "description": "Production server"}, ] diff --git a/{{cookiecutter.project_slug}}/config/settings/test.py b/{{cookiecutter.project_slug}}/config/settings/test.py index 7c54e0217..696b48710 100644 --- a/{{cookiecutter.project_slug}}/config/settings/test.py +++ b/{{cookiecutter.project_slug}}/config/settings/test.py @@ -2,7 +2,8 @@ With these settings, tests run faster. """ -from .base import * # noqa +from .base import * # noqa: F403 +from .base import TEMPLATES from .base import env # GENERAL @@ -27,7 +28,7 @@ EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend" # DEBUGGING FOR TEMPLATES # ------------------------------------------------------------------------------ -TEMPLATES[0]["OPTIONS"]["debug"] = True # type: ignore # noqa: F405 +TEMPLATES[0]["OPTIONS"]["debug"] = True # type: ignore[index] # MEDIA # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/config/urls.py b/{{cookiecutter.project_slug}}/config/urls.py index 7c5ad1a7e..5d9301b67 100644 --- a/{{cookiecutter.project_slug}}/config/urls.py +++ b/{{cookiecutter.project_slug}}/config/urls.py @@ -1,27 +1,37 @@ +# ruff: noqa from django.conf import settings from django.conf.urls.static import static from django.contrib import admin {%- if cookiecutter.use_async == 'y' %} from django.contrib.staticfiles.urls import staticfiles_urlpatterns {%- endif %} -from django.urls import include, path +from django.urls import include +from django.urls import path from django.views import defaults as default_views from django.views.generic import TemplateView {%- if cookiecutter.use_drf == 'y' %} -from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView +from drf_spectacular.views import SpectacularAPIView +from drf_spectacular.views import SpectacularSwaggerView from rest_framework.authtoken.views import obtain_auth_token {%- endif %} urlpatterns = [ path("", TemplateView.as_view(template_name="pages/home.html"), name="home"), - path("about/", TemplateView.as_view(template_name="pages/about.html"), name="about"), + path( + "about/", + TemplateView.as_view(template_name="pages/about.html"), + name="about", + ), # Django Admin, use {% raw %}{% url 'admin:index' %}{% endraw %} path(settings.ADMIN_URL, admin.site.urls), # User management path("users/", include("{{ cookiecutter.project_slug }}.users.urls", namespace="users")), path("accounts/", include("allauth.urls")), # Your stuff: custom urls includes go here -] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + # ... + # Media files + *static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT), +] {%- if cookiecutter.use_async == 'y' %} if settings.DEBUG: # Static file serving when using Gunicorn + Uvicorn for local web socket development diff --git a/{{cookiecutter.project_slug}}/config/wsgi.py b/{{cookiecutter.project_slug}}/config/wsgi.py index 1dbd8a8d8..73a6cddcb 100644 --- a/{{cookiecutter.project_slug}}/config/wsgi.py +++ b/{{cookiecutter.project_slug}}/config/wsgi.py @@ -1,3 +1,4 @@ +# ruff: noqa """ WSGI config for {{ cookiecutter.project_name }} project. diff --git a/{{cookiecutter.project_slug}}/docs/conf.py b/{{cookiecutter.project_slug}}/docs/conf.py index c640e1c63..40d59dbbb 100644 --- a/{{cookiecutter.project_slug}}/docs/conf.py +++ b/{{cookiecutter.project_slug}}/docs/conf.py @@ -1,3 +1,4 @@ +# ruff: noqa # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full diff --git a/{{cookiecutter.project_slug}}/manage.py b/{{cookiecutter.project_slug}}/manage.py index c44cc826d..a39871814 100755 --- a/{{cookiecutter.project_slug}}/manage.py +++ b/{{cookiecutter.project_slug}}/manage.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# ruff: noqa import os import sys from pathlib import Path @@ -13,7 +14,7 @@ if __name__ == "__main__": # issue is really that Django is missing to avoid masking other # exceptions on Python 2. try: - import django # noqa + import django except ImportError: raise ImportError( "Couldn't import Django. Are you sure it's installed and " diff --git a/{{cookiecutter.project_slug}}/merge_production_dotenvs_in_dotenv.py b/{{cookiecutter.project_slug}}/merge_production_dotenvs_in_dotenv.py index 35139fb2e..c83ed7166 100644 --- a/{{cookiecutter.project_slug}}/merge_production_dotenvs_in_dotenv.py +++ b/{{cookiecutter.project_slug}}/merge_production_dotenvs_in_dotenv.py @@ -1,3 +1,4 @@ +# ruff: noqa import os from collections.abc import Sequence from pathlib import Path diff --git a/{{cookiecutter.project_slug}}/tests/__init__.py b/{{cookiecutter.project_slug}}/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/__init__.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/__init__.py index 150a914ee..fb6532709 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/__init__.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/__init__.py @@ -1,2 +1,5 @@ __version__ = "{{ cookiecutter.version }}" -__version_info__ = tuple(int(num) if num.isdigit() else num for num in __version__.replace("-", ".", 1).split(".")) +__version_info__ = tuple( + int(num) if num.isdigit() else num + for num in __version__.replace("-", ".", 1).split(".") +) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/conftest.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/conftest.py index 7095a4714..98efcd75e 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/conftest.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/conftest.py @@ -5,10 +5,10 @@ from {{ cookiecutter.project_slug }}.users.tests.factories import UserFactory @pytest.fixture(autouse=True) -def media_storage(settings, tmpdir): +def _media_storage(settings, tmpdir) -> None: settings.MEDIA_ROOT = tmpdir.strpath -@pytest.fixture +@pytest.fixture() def user(db) -> User: return UserFactory() diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0001_initial.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0001_initial.py index 304cd6d7c..fd76afb25 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0001_initial.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0001_initial.py @@ -1,6 +1,7 @@ import django.contrib.sites.models from django.contrib.sites.models import _simple_domain_name_validator -from django.db import migrations, models +from django.db import migrations +from django.db import models class Migration(migrations.Migration): @@ -38,5 +39,5 @@ class Migration(migrations.Migration): }, bases=(models.Model,), managers=[("objects", django.contrib.sites.models.SiteManager())], - ) + ), ] diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0002_alter_domain_unique.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0002_alter_domain_unique.py index 2c8d6dac0..4a44a6a92 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0002_alter_domain_unique.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0002_alter_domain_unique.py @@ -1,5 +1,6 @@ import django.contrib.sites.models -from django.db import migrations, models +from django.db import migrations +from django.db import models class Migration(migrations.Migration): diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0003_set_site_domain_and_name.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0003_set_site_domain_and_name.py index e1822375b..85ee2d9c1 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0003_set_site_domain_and_name.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0003_set_site_domain_and_name.py @@ -23,7 +23,7 @@ def _update_or_create_site_with_sequence(site_model, connection, domain, name): # site is created. # To avoid this, we need to manually update DB sequence and make sure it's # greater than the maximum value. - max_id = site_model.objects.order_by('-id').first().id + max_id = site_model.objects.order_by("-id").first().id with connection.cursor() as cursor: cursor.execute("SELECT last_value from django_site_id_seq") (current_id,) = cursor.fetchone() diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/adapters.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/adapters.py index f9ae43a8e..484f686ad 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/adapters.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/adapters.py @@ -5,10 +5,11 @@ import typing from allauth.account.adapter import DefaultAccountAdapter from allauth.socialaccount.adapter import DefaultSocialAccountAdapter from django.conf import settings -from django.http import HttpRequest if typing.TYPE_CHECKING: from allauth.socialaccount.models import SocialLogin + from django.http import HttpRequest + from {{cookiecutter.project_slug}}.users.models import User @@ -18,10 +19,19 @@ class AccountAdapter(DefaultAccountAdapter): class SocialAccountAdapter(DefaultSocialAccountAdapter): - def is_open_for_signup(self, request: HttpRequest, sociallogin: SocialLogin) -> bool: + def is_open_for_signup( + self, + request: HttpRequest, + sociallogin: SocialLogin, + ) -> bool: return getattr(settings, "ACCOUNT_ALLOW_REGISTRATION", True) - def populate_user(self, request: HttpRequest, sociallogin: SocialLogin, data: dict[str, typing.Any]) -> User: + def populate_user( + self, + request: HttpRequest, + sociallogin: SocialLogin, + data: dict[str, typing.Any], + ) -> User: """ Populates user information from social provider info. diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py index 7fd49fa92..9d6c7562d 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py @@ -1,10 +1,12 @@ from django.conf import settings from django.contrib import admin from django.contrib.auth import admin as auth_admin -from django.contrib.auth import get_user_model, decorators +from django.contrib.auth import decorators +from django.contrib.auth import get_user_model from django.utils.translation import gettext_lazy as _ -from {{ cookiecutter.project_slug }}.users.forms import UserAdminChangeForm, UserAdminCreationForm +from {{ cookiecutter.project_slug }}.users.forms import UserAdminChangeForm +from {{ cookiecutter.project_slug }}.users.forms import UserAdminCreationForm User = get_user_model() diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py index 0872d06f4..ef2adb911 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py @@ -3,7 +3,6 @@ from rest_framework import serializers from {{ cookiecutter.project_slug }}.users.models import User as UserType - User = get_user_model() diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/views.py index 508431e4c..8bdf24b0b 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/views.py @@ -1,7 +1,9 @@ from django.contrib.auth import get_user_model from rest_framework import status from rest_framework.decorators import action -from rest_framework.mixins import ListModelMixin, RetrieveModelMixin, UpdateModelMixin +from rest_framework.mixins import ListModelMixin +from rest_framework.mixins import RetrieveModelMixin +from rest_framework.mixins import UpdateModelMixin from rest_framework.response import Response from rest_framework.viewsets import GenericViewSet diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/apps.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/apps.py index 92e7a74ec..5c3d4fe08 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/apps.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/apps.py @@ -1,3 +1,5 @@ +import contextlib + from django.apps import AppConfig from django.utils.translation import gettext_lazy as _ @@ -7,7 +9,5 @@ class UsersConfig(AppConfig): verbose_name = _("Users") def ready(self): - try: + with contextlib.suppress(ImportError): import {{ cookiecutter.project_slug }}.users.signals # noqa: F401 - except ImportError: - pass diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py index 03ac29548..c75c0e970 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py @@ -15,7 +15,8 @@ class UserManager(DjangoUserManager["User"]): Create and save a user with the given email and password. """ if not email: - raise ValueError("The given email must be set") + msg = "The given email must be set" + raise ValueError(msg) email = self.normalize_email(email) user = self.model(email=email, **extra_fields) user.password = make_password(password) @@ -32,8 +33,10 @@ class UserManager(DjangoUserManager["User"]): extra_fields.setdefault("is_superuser", True) if extra_fields.get("is_staff") is not True: - raise ValueError("Superuser must have is_staff=True.") + msg = "Superuser must have is_staff=True." + raise ValueError(msg) if extra_fields.get("is_superuser") is not True: - raise ValueError("Superuser must have is_superuser=True.") + msg = "Superuser must have is_superuser=True." + raise ValueError(msg) return self._create_user(email, password, **extra_fields) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/migrations/0001_initial.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/migrations/0001_initial.py index 58a439c5d..cee6676bc 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/migrations/0001_initial.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/migrations/0001_initial.py @@ -1,7 +1,8 @@ import django.contrib.auth.models import django.contrib.auth.validators -from django.db import migrations, models import django.utils.timezone +from django.db import migrations +from django.db import models import {{cookiecutter.project_slug}}.users.models @@ -31,7 +32,7 @@ class Migration(migrations.Migration): ( "last_login", models.DateTimeField( - blank=True, null=True, verbose_name="last login" + blank=True, null=True, verbose_name="last login", ), ), ( @@ -61,14 +62,14 @@ class Migration(migrations.Migration): ( "email", models.EmailField( - blank=True, max_length=254, verbose_name="email address" + blank=True, max_length=254, verbose_name="email address", ), ), {%- else %} ( "email", models.EmailField( - unique=True, max_length=254, verbose_name="email address" + unique=True, max_length=254, verbose_name="email address", ), ), {%- endif %} @@ -91,13 +92,13 @@ class Migration(migrations.Migration): ( "date_joined", models.DateTimeField( - default=django.utils.timezone.now, verbose_name="date joined" + default=django.utils.timezone.now, verbose_name="date joined", ), ), ( "name", models.CharField( - blank=True, max_length=255, verbose_name="Name of User" + blank=True, max_length=255, verbose_name="Name of User", ), ), ( diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py index ccb6b78ae..fd78c26a8 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py @@ -1,9 +1,12 @@ {%- if cookiecutter.username_type == "email" %} from typing import ClassVar -{%- endif %} +{% endif -%} from django.contrib.auth.models import AbstractUser -from django.db.models import CharField{% if cookiecutter.username_type == "email" %}, EmailField{% endif %} +from django.db.models import CharField +{%- if cookiecutter.username_type == "email" %} +from django.db.models import EmailField +{%- endif %} from django.urls import reverse from django.utils.translation import gettext_lazy as _ {%- if cookiecutter.username_type == "email" %} @@ -21,11 +24,11 @@ class User(AbstractUser): # First and last name do not cover name patterns around the globe name = CharField(_("Name of User"), blank=True, max_length=255) - first_name = None # type: ignore - last_name = None # type: ignore + first_name = None # type: ignore[assignment] + last_name = None # type: ignore[assignment] {%- if cookiecutter.username_type == "email" %} email = EmailField(_("email address"), unique=True) - username = None # type: ignore + username = None # type: ignore[assignment] USERNAME_FIELD = "email" REQUIRED_FIELDS = [] diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py index bebd8adcf..f614681bb 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py @@ -2,7 +2,8 @@ from collections.abc import Sequence from typing import Any from django.contrib.auth import get_user_model -from factory import Faker, post_generation +from factory import Faker +from factory import post_generation from factory.django import DjangoModelFactory @@ -14,7 +15,7 @@ class UserFactory(DjangoModelFactory): name = Faker("name") @post_generation - def password(self, create: bool, extracted: Sequence[Any], **kwargs): + def password(self, create: bool, extracted: Sequence[Any], **kwargs): # noqa: FBT001 password = ( extracted if extracted 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 095b2cbbf..f802b8ba1 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 @@ -1,3 +1,5 @@ +import contextlib +from http import HTTPStatus from importlib import reload import pytest @@ -13,17 +15,17 @@ class TestUserAdmin: def test_changelist(self, admin_client): url = reverse("admin:users_user_changelist") response = admin_client.get(url) - assert response.status_code == 200 + assert response.status_code == HTTPStatus.OK def test_search(self, admin_client): url = reverse("admin:users_user_changelist") response = admin_client.get(url, data={"q": "test"}) - assert response.status_code == 200 + assert response.status_code == HTTPStatus.OK def test_add(self, admin_client): url = reverse("admin:users_user_add") response = admin_client.get(url) - assert response.status_code == 200 + assert response.status_code == HTTPStatus.OK response = admin_client.post( url, @@ -37,7 +39,7 @@ class TestUserAdmin: "password2": "My_R@ndom-P@ssw0rd", }, ) - assert response.status_code == 302 + assert response.status_code == HTTPStatus.FOUND {%- if cookiecutter.username_type == "email" %} assert User.objects.filter(email="new-admin@example.com").exists() {%- else %} @@ -52,21 +54,19 @@ class TestUserAdmin: {%- endif %} url = reverse("admin:users_user_change", kwargs={"object_id": user.pk}) response = admin_client.get(url) - assert response.status_code == 200 + assert response.status_code == HTTPStatus.OK - @pytest.fixture - def force_allauth(self, settings): + @pytest.fixture() + def _force_allauth(self, settings): settings.DJANGO_ADMIN_FORCE_ALLAUTH = True # Reload the admin module to apply the setting change import {{ cookiecutter.project_slug }}.users.admin as users_admin - try: + with contextlib.suppress(admin.sites.AlreadyRegistered): reload(users_admin) - except admin.sites.AlreadyRegistered: - pass - @pytest.mark.django_db - @pytest.mark.usefixtures("force_allauth") + @pytest.mark.django_db() + @pytest.mark.usefixtures("_force_allauth") def test_allauth_login(self, rf, settings): request = rf.get("/fake-url") request.user = AnonymousUser() diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_urls.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_urls.py index 334ab1185..b445b611d 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_urls.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_urls.py @@ -1,14 +1,20 @@ -from django.urls import resolve, reverse +from django.urls import resolve +from django.urls import reverse from {{ cookiecutter.project_slug }}.users.models import User def test_user_detail(user: User): {%- if cookiecutter.username_type == "email" %} - assert reverse("api:user-detail", kwargs={"pk": user.pk}) == f"/api/users/{user.pk}/" + assert ( + reverse("api:user-detail", kwargs={"pk": user.pk}) == f"/api/users/{user.pk}/" + ) assert resolve(f"/api/users/{user.pk}/").view_name == "api:user-detail" {%- else %} - assert reverse("api:user-detail", kwargs={"username": user.username}) == f"/api/users/{user.username}/" + assert ( + reverse("api:user-detail", kwargs={"username": user.username}) + == f"/api/users/{user.username}/" + ) assert resolve(f"/api/users/{user.username}/").view_name == "api:user-detail" {%- endif %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py index 90e84dc7d..955ebe4eb 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py @@ -6,7 +6,7 @@ from {{ cookiecutter.project_slug }}.users.models import User class TestUserViewSet: - @pytest.fixture + @pytest.fixture() def api_rf(self) -> APIRequestFactory: return APIRequestFactory() @@ -26,7 +26,7 @@ class TestUserViewSet: view.request = request - response = view.me(request) # type: ignore + response = view.me(request) # type: ignore[call-arg, arg-type, misc] assert response.data == { {%- if cookiecutter.username_type == "email" %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py index ca624c89a..17d0d72a1 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py @@ -30,7 +30,7 @@ class TestUserAdminCreationForm: {%- endif %} "password1": user.password, "password2": user.password, - } + }, ) assert not form.is_valid() diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_managers.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_managers.py index f25af4ee2..e5e5f5a4b 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_managers.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_managers.py @@ -6,12 +6,12 @@ from django.core.management import call_command from {{ cookiecutter.project_slug }}.users.models import User -@pytest.mark.django_db +@pytest.mark.django_db() class TestUserManager: def test_create_user(self): user = User.objects.create_user( email="john@example.com", - password="something-r@nd0m!", + password="something-r@nd0m!", # noqa: S106 ) assert user.email == "john@example.com" assert not user.is_staff @@ -22,7 +22,7 @@ class TestUserManager: def test_create_superuser(self): user = User.objects.create_superuser( email="admin@example.com", - password="something-r@nd0m!", + password="something-r@nd0m!", # noqa: S106 ) assert user.email == "admin@example.com" assert user.is_staff @@ -32,12 +32,12 @@ class TestUserManager: def test_create_superuser_username_ignored(self): user = User.objects.create_superuser( email="test@example.com", - password="something-r@nd0m!", + password="something-r@nd0m!", # noqa: S106 ) assert user.username is None -@pytest.mark.django_db +@pytest.mark.django_db() def test_createsuperuser_command(): """Ensure createsuperuser command works with our custom manager.""" out = StringIO() diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_swagger.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_swagger.py index f97658b55..3081d1f65 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_swagger.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_swagger.py @@ -1,3 +1,5 @@ +from http import HTTPStatus + import pytest from django.urls import reverse @@ -5,17 +7,17 @@ from django.urls import reverse def test_swagger_accessible_by_admin(admin_client): url = reverse("api-docs") response = admin_client.get(url) - assert response.status_code == 200 + assert response.status_code == HTTPStatus.OK -@pytest.mark.django_db +@pytest.mark.django_db() def test_swagger_ui_not_accessible_by_normal_user(client): url = reverse("api-docs") response = client.get(url) - assert response.status_code == 403 + assert response.status_code == HTTPStatus.FORBIDDEN def test_api_schema_generated_successfully(admin_client): url = reverse("api-schema") response = admin_client.get(url) - assert response.status_code == 200 + assert response.status_code == HTTPStatus.OK diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_tasks.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_tasks.py index 41d5af292..d3f610139 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_tasks.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_tasks.py @@ -9,8 +9,9 @@ pytestmark = pytest.mark.django_db def test_user_count(settings): """A basic test to execute the get_users_count Celery task.""" - UserFactory.create_batch(3) + batch_size = 3 + UserFactory.create_batch(batch_size) settings.CELERY_TASK_ALWAYS_EAGER = True task_result = get_users_count.delay() assert isinstance(task_result, EagerResult) - assert task_result.result == 3 + assert task_result.result == batch_size diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py index a0d068890..aaacb05a1 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py @@ -1,4 +1,5 @@ -from django.urls import resolve, reverse +from django.urls import resolve +from django.urls import reverse from {{ cookiecutter.project_slug }}.users.models import User @@ -8,7 +9,10 @@ def test_detail(user: User): assert reverse("users:detail", kwargs={"pk": user.pk}) == f"/users/{user.pk}/" assert resolve(f"/users/{user.pk}/").view_name == "users:detail" {%- else %} - assert reverse("users:detail", kwargs={"username": user.username}) == f"/users/{user.username}/" + assert ( + reverse("users:detail", kwargs={"username": user.username}) + == f"/users/{user.username}/" + ) assert resolve(f"/users/{user.username}/").view_name == "users:detail" {%- endif %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py index 2c1027038..136daa402 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py @@ -1,10 +1,13 @@ +from http import HTTPStatus + import pytest from django.conf import settings from django.contrib import messages from django.contrib.auth.models import AnonymousUser from django.contrib.messages.middleware import MessageMiddleware from django.contrib.sessions.middleware import SessionMiddleware -from django.http import HttpRequest, HttpResponseRedirect +from django.http import HttpRequest +from django.http import HttpResponseRedirect from django.test import RequestFactory from django.urls import reverse from django.utils.translation import gettext_lazy as _ @@ -12,11 +15,9 @@ from django.utils.translation import gettext_lazy as _ from {{ cookiecutter.project_slug }}.users.forms import UserAdminChangeForm from {{ cookiecutter.project_slug }}.users.models import User from {{ cookiecutter.project_slug }}.users.tests.factories import UserFactory -from {{ cookiecutter.project_slug }}.users.views import ( - UserRedirectView, - UserUpdateView, - user_detail_view, -) +from {{ cookiecutter.project_slug }}.users.views import UserRedirectView +from {{ cookiecutter.project_slug }}.users.views import UserUpdateView +from {{ cookiecutter.project_slug }}.users.views import user_detail_view pytestmark = pytest.mark.django_db @@ -102,7 +103,7 @@ class TestUserDetailView: response = user_detail_view(request, username=user.username) {%- endif %} - assert response.status_code == 200 + assert response.status_code == HTTPStatus.OK def test_not_authenticated(self, user: User, rf: RequestFactory): request = rf.get("/fake-url/") @@ -116,5 +117,5 @@ class TestUserDetailView: login_url = reverse(settings.LOGIN_URL) assert isinstance(response, HttpResponseRedirect) - assert response.status_code == 302 + assert response.status_code == HTTPStatus.FOUND assert response.url == f"{login_url}?next=/fake-url/" diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py index 0ffca17aa..40719ed21 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py @@ -1,10 +1,8 @@ from django.urls import path -from {{ cookiecutter.project_slug }}.users.views import ( - user_detail_view, - user_redirect_view, - user_update_view, -) +from {{ cookiecutter.project_slug }}.users.views import user_detail_view +from {{ cookiecutter.project_slug }}.users.views import user_redirect_view +from {{ cookiecutter.project_slug }}.users.views import user_update_view app_name = "users" urlpatterns = [ diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py index 82498e630..6d26e9c75 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py @@ -3,7 +3,9 @@ from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.messages.views import SuccessMessageMixin from django.urls import reverse from django.utils.translation import gettext_lazy as _ -from django.views.generic import DetailView, RedirectView, UpdateView +from django.views.generic import DetailView +from django.views.generic import RedirectView +from django.views.generic import UpdateView User = get_user_model() @@ -28,7 +30,8 @@ class UserUpdateView(LoginRequiredMixin, SuccessMessageMixin, UpdateView): success_message = _("Information successfully updated") def get_success_url(self): - assert self.request.user.is_authenticated # for mypy to know that the user is authenticated + # for mypy to know that the user is authenticated + assert self.request.user.is_authenticated return self.request.user.get_absolute_url() def get_object(self): From 9a5b9c2f53e8b5f685bb04592354778c07b170e9 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 13 Feb 2024 12:05:49 +0000 Subject: [PATCH 069/234] Update sentry-sdk from 1.40.3 to 1.40.4 --- {{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 b6e793e11..90865d0b5 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==1.40.3 # https://github.com/getsentry/sentry-python +sentry-sdk==1.40.4 # 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 bf9a861ddc34d1b746c8e4a3850389c80cccde64 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 14 Feb 2024 02:10:20 +0000 Subject: [PATCH 070/234] Release 2024.02.13 --- CHANGELOG.md | 19 +++++++++++++++++++ setup.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ee7a5895..bf6cbe02d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,25 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.02.13 + + +### Changed + +- Ruff linting & formatting ([#4834](https://github.com/cookiecutter/cookiecutter-django/pull/4834)) + +### Updated + +- Update uvicorn to 0.27.1 ([#4848](https://github.com/cookiecutter/cookiecutter-django/pull/4848)) + +- Update sentry-sdk to 1.40.4 ([#4858](https://github.com/cookiecutter/cookiecutter-django/pull/4858)) + +- Bump traefik to 2.11.0 ([#4857](https://github.com/cookiecutter/cookiecutter-django/pull/4857)) + +- Auto-update pre-commit hooks ([#4855](https://github.com/cookiecutter/cookiecutter-django/pull/4855)) + +- Update black to 24.2.0 ([#4853](https://github.com/cookiecutter/cookiecutter-django/pull/4853)) + ## 2024.02.12 diff --git a/setup.py b/setup.py index 7c129824d..bb08c3b44 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.02.12" +version = "2024.02.13" with open("README.md") as readme_file: long_description = readme_file.read() From fd959eedd93b95e6200c51e226edaf7773182857 Mon Sep 17 00:00:00 2001 From: mpsantos Date: Fri, 16 Feb 2024 06:52:55 -0300 Subject: [PATCH 071/234] Added link to the ruff repository (#4866) --- {{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 da0e04943..fb0eda72c 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -28,7 +28,7 @@ sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ -ruff==0.2.1 +ruff==0.2.1 # https://github.com/astral-sh/ruff coverage==7.4.1 # https://github.com/nedbat/coveragepy djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pre-commit==3.6.1 # https://github.com/pre-commit/pre-commit From 6237573637d09406bdd93d564e6999d4ec3d3f89 Mon Sep 17 00:00:00 2001 From: Paul Wulff <121822604+mtmpaulwulff@users.noreply.github.com> Date: Fri, 16 Feb 2024 10:55:24 +0100 Subject: [PATCH 072/234] Speed up CI pytest by 30%: Change ci.yml to only build images relevant for running pytest (#4863) In order to run pytest we can constrain the build command to only build the images related to the django service. This mainly prevents the docs image from being built unnecessarily. This cuts run time of the Github Actions workflow from approx. 4min 30s to below 3min. --- {{cookiecutter.project_slug}}/.github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index e39933fe1..414ee1e60 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: - name: Run pre-commit uses: pre-commit/action@v3.0.0 - # With no caching at all the entire ci process takes 4m 30s to complete! + # With no caching at all the entire ci process takes 3m to complete! pytest: runs-on: ubuntu-latest {%- if cookiecutter.use_docker == 'n' %} @@ -69,7 +69,7 @@ jobs: {%- if cookiecutter.use_docker == 'y' %} - name: Build the Stack - run: docker compose -f local.yml build + run: docker compose -f local.yml build django - name: Run DB Migrations run: docker compose -f local.yml run --rm django python manage.py migrate From 80147bd3404d0938983b62c7031a89e6a0765f6e Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 16 Feb 2024 09:55:59 +0000 Subject: [PATCH 073/234] 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 c95797b18..596f2af83 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1518,5 +1518,10 @@ "name": "henningbra", "github_login": "henningbra", "twitter_username": "" + }, + { + "name": "Paul Wulff", + "github_login": "mtmpaulwulff", + "twitter_username": "" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 7b778f439..9a59b6572 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1650,6 +1650,13 @@ Listed in alphabetical order. + + Paul Wulff + + mtmpaulwulff + + + Pawan Chaurasia From f77233d7c0940208eda61fc680d642e745175076 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 16 Feb 2024 02:14:57 -0800 Subject: [PATCH 074/234] Update gitpython to 3.1.42 (#4864) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3de15dc6f..c0385c69b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,6 +21,6 @@ pyyaml==6.0.1 # Scripting # ------------------------------------------------------------------------------ PyGithub==2.2.0 -gitpython==3.1.41 +gitpython==3.1.42 jinja2==3.1.3 requests==2.31.0 From cb0e06dcbdc72f2e5e6c5a39e16601e2721b806a Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 17 Feb 2024 02:09:39 +0000 Subject: [PATCH 075/234] Release 2024.02.16 --- CHANGELOG.md | 11 +++++++++++ setup.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf6cbe02d..f0ef07835 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.02.16 + + +### Changed + +- Speed up GitHub CI for Docker setup ([#4863](https://github.com/cookiecutter/cookiecutter-django/pull/4863)) + +### Documentation + +- Add link to the ruff repository in requirements ([#4866](https://github.com/cookiecutter/cookiecutter-django/pull/4866)) + ## 2024.02.13 diff --git a/setup.py b/setup.py index bb08c3b44..b5b999779 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.02.13" +version = "2024.02.16" with open("README.md") as readme_file: long_description = readme_file.read() From dea7316a629c18ac235e3ce26178fe48eb74cd4e Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 17 Feb 2024 02:25:34 -0800 Subject: [PATCH 076/234] Update tox to 4.13.0 (#4868) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c0385c69b..17a01d599 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ pre-commit==3.6.1 # Testing # ------------------------------------------------------------------------------ -tox==4.12.1 +tox==4.13.0 pytest==8.0.0 pytest-xdist==3.5.0 pytest-cookies==0.7.0 From 7db193d9fac5f862f546c13444b1e676a25c3783 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 17 Feb 2024 02:39:05 -0800 Subject: [PATCH 077/234] Update pytest to 8.0.1 (#4870) * Update pytest from 8.0.0 to 8.0.1 * Update pytest from 8.0.0 to 8.0.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 17a01d599..077ce3f75 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ pre-commit==3.6.1 # Testing # ------------------------------------------------------------------------------ tox==4.13.0 -pytest==8.0.0 +pytest==8.0.1 pytest-xdist==3.5.0 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 fb0eda72c..4c142ff66 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.7.1 # https://github.com/python/mypy django-stubs[compatible-mypy]==4.2.7 # https://github.com/typeddjango/django-stubs -pytest==8.0.0 # https://github.com/pytest-dev/pytest +pytest==8.0.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.14.5 # https://github.com/typeddjango/djangorestframework-stubs From 2ac513e0c1bc6c9e66fee619fe5db8a304daf307 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 18 Feb 2024 02:11:43 +0000 Subject: [PATCH 078/234] Release 2024.02.17 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0ef07835..8d7e382e3 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.02.17 + + +### Updated + +- Update pytest to 8.0.1 ([#4870](https://github.com/cookiecutter/cookiecutter-django/pull/4870)) + ## 2024.02.16 diff --git a/setup.py b/setup.py index b5b999779..6637e9e7b 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.02.16" +version = "2024.02.17" with open("README.md") as readme_file: long_description = readme_file.read() From adebac5b88c337e1558ba7e90764db729b111edf Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 19 Feb 2024 08:30:11 -0800 Subject: [PATCH 079/234] Update sentry-sdk from 1.40.4 to 1.40.5 (#4876) --- {{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 90865d0b5..4d96e86e1 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==1.40.4 # https://github.com/getsentry/sentry-python +sentry-sdk==1.40.5 # 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 8c60674654fd6ce4a217e3adb86d915eee3fbc5e Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 20 Feb 2024 02:09:27 +0000 Subject: [PATCH 080/234] Release 2024.02.19 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d7e382e3..1f9b07857 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.02.19 + + +### Updated + +- Update sentry-sdk to 1.40.5 ([#4876](https://github.com/cookiecutter/cookiecutter-django/pull/4876)) + ## 2024.02.17 diff --git a/setup.py b/setup.py index 6637e9e7b..b29fc417a 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.02.17" +version = "2024.02.19" with open("README.md") as readme_file: long_description = readme_file.read() From b756d904d77e992242caeba4fbd188bccfa0c782 Mon Sep 17 00:00:00 2001 From: Matthew Foster Walsh <15671892+mfosterw@users.noreply.github.com> Date: Wed, 21 Feb 2024 05:01:56 -0500 Subject: [PATCH 081/234] You probably don't need `get_user_model` (#4879) * You probably don't need `get_user_model` Fixes #4872 * Fix Flake8 (add space after import) * (try to) fix ruff * Fix import format --- .github/contributors.json | 2 +- .../{{cookiecutter.project_slug}}/users/admin.py | 8 +++----- .../users/api/serializers.py | 7 ++----- .../{{cookiecutter.project_slug}}/users/api/views.py | 5 ++--- .../{{cookiecutter.project_slug}}/users/forms.py | 3 +-- .../{{cookiecutter.project_slug}}/users/tasks.py | 5 +---- .../users/tests/factories.py | 5 +++-- .../{{cookiecutter.project_slug}}/users/views.py | 3 +-- 8 files changed, 14 insertions(+), 24 deletions(-) diff --git a/.github/contributors.json b/.github/contributors.json index 596f2af83..057309a52 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1115,7 +1115,7 @@ "twitter_username": "Qoyyuum" }, { - "name": "mfosterw", + "name": "Matthew Foster Walsh", "github_login": "mfosterw", "twitter_username": "" }, diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py index 9d6c7562d..d0d1488f8 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py @@ -1,19 +1,17 @@ from django.conf import settings from django.contrib import admin from django.contrib.auth import admin as auth_admin -from django.contrib.auth import decorators -from django.contrib.auth import get_user_model +from django.contrib.auth.decorators import login_required from django.utils.translation import gettext_lazy as _ from {{ cookiecutter.project_slug }}.users.forms import UserAdminChangeForm from {{ cookiecutter.project_slug }}.users.forms import UserAdminCreationForm - -User = get_user_model() +from {{ cookiecutter.project_slug }}.users.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 = decorators.login_required(admin.site.login) # type: ignore[method-assign] + admin.site.login = login_required(admin.site.login) # type: ignore[method-assign] @admin.register(User) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py index ef2adb911..51e0859f3 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py @@ -1,12 +1,9 @@ -from django.contrib.auth import get_user_model from rest_framework import serializers -from {{ cookiecutter.project_slug }}.users.models import User as UserType - -User = get_user_model() +from {{ cookiecutter.project_slug }}.users.models import User -class UserSerializer(serializers.ModelSerializer[UserType]): +class UserSerializer(serializers.ModelSerializer[User]): class Meta: model = User {%- if cookiecutter.username_type == "email" %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/views.py index 8bdf24b0b..7a521cdfe 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/views.py @@ -1,4 +1,3 @@ -from django.contrib.auth import get_user_model from rest_framework import status from rest_framework.decorators import action from rest_framework.mixins import ListModelMixin @@ -7,9 +6,9 @@ from rest_framework.mixins import UpdateModelMixin from rest_framework.response import Response from rest_framework.viewsets import GenericViewSet -from .serializers import UserSerializer +from {{ cookiecutter.project_slug }}.users.models import User -User = get_user_model() +from .serializers import UserSerializer class UserViewSet(RetrieveModelMixin, ListModelMixin, UpdateModelMixin, GenericViewSet): diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py index ac5b647d3..2d18de208 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py @@ -1,13 +1,12 @@ from allauth.account.forms import SignupForm from allauth.socialaccount.forms import SignupForm as SocialSignupForm from django.contrib.auth import forms as admin_forms -from django.contrib.auth import get_user_model {%- if cookiecutter.username_type == "email" %} from django.forms import EmailField {%- endif %} from django.utils.translation import gettext_lazy as _ -User = get_user_model() +from {{ cookiecutter.project_slug }}.users.models import User class UserAdminChangeForm(admin_forms.UserChangeForm): diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py index c99341c5f..ecd14d2a5 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py @@ -1,8 +1,5 @@ -from django.contrib.auth import get_user_model - from config import celery_app - -User = get_user_model() +from {{ cookiecutter.project_slug }}.users.models import User @celery_app.task() diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py index f614681bb..136d0b1d5 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py @@ -1,11 +1,12 @@ from collections.abc import Sequence from typing import Any -from django.contrib.auth import get_user_model from factory import Faker from factory import post_generation from factory.django import DjangoModelFactory +from {{ cookiecutter.project_slug }}.users.models import User + class UserFactory(DjangoModelFactory): {%- if cookiecutter.username_type == "username" %} @@ -38,5 +39,5 @@ class UserFactory(DjangoModelFactory): instance.save() class Meta: - model = get_user_model() + model = User django_get_or_create = ["{{cookiecutter.username_type}}"] diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py index 6d26e9c75..3f20f2686 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py @@ -1,4 +1,3 @@ -from django.contrib.auth import get_user_model from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.messages.views import SuccessMessageMixin from django.urls import reverse @@ -7,7 +6,7 @@ from django.views.generic import DetailView from django.views.generic import RedirectView from django.views.generic import UpdateView -User = get_user_model() +from {{ cookiecutter.project_slug }}.users.models import User class UserDetailView(LoginRequiredMixin, DetailView): From 4391f1da5cc44a7eec0245281716ee52c6f72938 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 21 Feb 2024 10:02:45 +0000 Subject: [PATCH 082/234] Update Contributors --- CONTRIBUTORS.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9a59b6572..734900362 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1454,6 +1454,13 @@ Listed in alphabetical order. + + Matthew Foster Walsh + + mfosterw + + + Matthew Sisley @@ -1489,13 +1496,6 @@ Listed in alphabetical order. - - mfosterw - - mfosterw - - - Michael Gecht From 8031a2a51a1558a9266701d618fba18b80a6c4fb Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 21 Feb 2024 05:37:47 -0800 Subject: [PATCH 083/234] Update ruff to 0.2.2 (#4871) * Update ruff from 0.2.1 to 0.2.2 * Update ruff from 0.2.1 to 0.2.2 --- 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 077ce3f75..2a29b915c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -ruff==0.2.1 +ruff==0.2.2 django-upgrade==1.16.0 djlint==1.34.1 pre-commit==3.6.1 diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 4c142ff66..b91e431b7 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -28,7 +28,7 @@ sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ -ruff==0.2.1 # https://github.com/astral-sh/ruff +ruff==0.2.2 # https://github.com/astral-sh/ruff coverage==7.4.1 # https://github.com/nedbat/coveragepy djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pre-commit==3.6.1 # https://github.com/pre-commit/pre-commit From c6bd47a1bf36126628db4e855a84bc0214ff6a65 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 21 Feb 2024 05:38:02 -0800 Subject: [PATCH 084/234] Update pre-commit to 3.6.2 (#4874) * Update pre-commit from 3.6.1 to 3.6.2 * Update pre-commit from 3.6.1 to 3.6.2 --- 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 2a29b915c..3635390f1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,7 @@ binaryornot==0.4.4 ruff==0.2.2 django-upgrade==1.16.0 djlint==1.34.1 -pre-commit==3.6.1 +pre-commit==3.6.2 # Testing # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index b91e431b7..8225dab0f 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -31,7 +31,7 @@ sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild ruff==0.2.2 # https://github.com/astral-sh/ruff coverage==7.4.1 # https://github.com/nedbat/coveragepy djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint -pre-commit==3.6.1 # https://github.com/pre-commit/pre-commit +pre-commit==3.6.2 # https://github.com/pre-commit/pre-commit # Django # ------------------------------------------------------------------------------ From 70cde064d431bbb6bf1b8fa82bb70503bb80a1d3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:18:53 +0000 Subject: [PATCH 085/234] Auto-update pre-commit hooks (#4873) Co-authored-by: browniebroke <861044+browniebroke@users.noreply.github.com> Co-authored-by: Bruno Alla --- .pre-commit-config.yaml | 2 +- {{cookiecutter.project_slug}}/.pre-commit-config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7daf6ac71..6355c5ac7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,7 @@ repos: args: ["--tab-width", "2"] - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + rev: v3.15.1 hooks: - id: pyupgrade args: [--py311-plus] diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 7c9565e19..1d06c042f 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.2.1 + rev: v0.2.2 hooks: # Linter - id: ruff From a247d8f8a20344dd3388e5d81f758b5fe4cefa65 Mon Sep 17 00:00:00 2001 From: Matthew Foster Walsh <15671892+mfosterw@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:07:25 -0500 Subject: [PATCH 086/234] Switch to celery.shared_task (#4881) * Switch to celery.shared_task * Sort impots --------- Co-authored-by: Bruno Alla --- .../{{cookiecutter.project_slug}}/users/tasks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py index ecd14d2a5..2afd4d4bd 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py @@ -1,8 +1,9 @@ -from config import celery_app +from celery import shared_task + from {{ cookiecutter.project_slug }}.users.models import User -@celery_app.task() +@shared_task() def get_users_count(): """A pointless Celery task to demonstrate usage.""" return User.objects.count() From ee55aa29b48ff994d0cb8c0872b2d929e2c23c32 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 22 Feb 2024 02:10:02 +0000 Subject: [PATCH 087/234] Release 2024.02.21 --- CHANGELOG.md | 17 +++++++++++++++++ setup.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f9b07857..b8ad3f6bf 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.02.21 + + +### Changed + +- Switch to `celery.shared_task` to define tasks ([#4881](https://github.com/cookiecutter/cookiecutter-django/pull/4881)) + +- Replace usages of `get_user_model` by importing model directly ([#4879](https://github.com/cookiecutter/cookiecutter-django/pull/4879)) + +### Updated + +- Auto-update pre-commit hooks ([#4873](https://github.com/cookiecutter/cookiecutter-django/pull/4873)) + +- Update pre-commit to 3.6.2 ([#4874](https://github.com/cookiecutter/cookiecutter-django/pull/4874)) + +- Update ruff to 0.2.2 ([#4871](https://github.com/cookiecutter/cookiecutter-django/pull/4871)) + ## 2024.02.19 diff --git a/setup.py b/setup.py index b29fc417a..62b38573d 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.02.19" +version = "2024.02.21" with open("README.md") as readme_file: long_description = readme_file.read() From 49a66b3583c2f15ee816efa84fee64c76f93d35e Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 22 Feb 2024 00:36:44 -0800 Subject: [PATCH 088/234] Update cookiecutter to 2.6.0 (#4882) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3635390f1..138744a26 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -cookiecutter==2.5.0 +cookiecutter==2.6.0 sh==2.0.6; sys_platform != "win32" binaryornot==0.4.4 From a76656aba16c35a2c1bb7e35a238d5271446dac4 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 22 Feb 2024 10:39:45 +0100 Subject: [PATCH 089/234] Add a maintainer guide to the docs --- docs/index.rst | 1 + docs/maintainer-guide.md | 93 ++++++++++++++++++++++++++++++++++ scripts/update_contributors.py | 4 +- 3 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 docs/maintainer-guide.md diff --git a/docs/index.rst b/docs/index.rst index da5186487..70daa1852 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -28,6 +28,7 @@ Contents faq troubleshooting contributing + maintainer-guide Indices and tables ------------------ diff --git a/docs/maintainer-guide.md b/docs/maintainer-guide.md new file mode 100644 index 000000000..508918abe --- /dev/null +++ b/docs/maintainer-guide.md @@ -0,0 +1,93 @@ +# Maintainer guide + +This document is intended for maintainers of the template. + +## Automation scripts + +We have a few workflows which have been automated over time. They usually run using GitHub actions and might need a few small manual actions to work nicely. Some have a few limitations which we should document here. + +### CI + +`ci.yml` + +The CI workflow tries to cover 2 main aspects of the template: + +- Check all combinations to make sure that valid files are generated with no major linting issues. Issues which are fixed by an auto-formatter after generation aren't considered major, and only aim for best effort. This is under the `test` job. +- Run more in-depth tests on a few combinations, by installing dependencies, running type checker and the test suite of the generated project. We try to cover docker (`docker` job) and non-docker (`bare` job) setups. + +We also run the deployment checks, but we don't do much more beyond that for testing the production setup. + +### Django issue checker + +`django-issue-checker.yml` + +This workflow runs daily, on schedule, and checks if there is a new major version of Django (not in the pure SemVer sense) released that we are not running, and list our dependencies compatibility. + +For example, at time of writing, we use Django 4.2, but the latest version of Django is 5.0, so the workflow created a ["Django 5.0" issue](https://github.com/cookiecutter/cookiecutter-django/issues/4724) in GitHub, with a compatibility table and keeps it up to date every day. + +#### Limitations + +Here are a few current and past limitations of the script + +- When a new dependency is added to the template, the script fails to update an existing issue +- Not sure what happens when a deps is removed +- ~~Unable to parse classifiers without minor version~~ +- ~~Creates an issue even if we are on the latest version~~ + +### Issue manager + +`issue-manager.yml` + +A workflow that uses [Sebastian Ramirez' issue-manager](https://github.com/tiangolo/issue-manager) to help us automate issue management. The tag line from the repo explains it well: + +> Automatically close issues or Pull Requests that have a label, after a custom delay, if no one replies back. + +It runs on a schedule as well as when some actions are taken on issues and pull requests. + +We wait 10 days before closing issues, and we have a few customised reasons, which are configured in the workflow itself. The config should be fairly self-explanatory. + +### Pre-commit auto-update + +`pre-commit-autoupdate.yml` + +Run daily, to do `pre-commit autoupdate` on the template as well as the generated project, and opens a pull request with the changes. + +#### Limitations + +- The PR is open as GitHub action which means that CI does NOT run. The documentation for create-pull-request action [explains why](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs). +- Some hooks are also installed as local dependencies (via `requirements/local.txt`), but these are updated separately via PyUP. + +### Update changelog + +`update-changelog.yml` + +Run daily at 2AM to update our changelog and create a GitHub release. This runs a custom script which: + +- List all pull requests merged the day before +- The release name is calendar based, so `YYYY.MM.DD` +- For each PR: + - Get the PR title to summarize the change + - Look at the PR labels to classify it in a section of the release notes: + - anything labelled `project infrastructure` is excluded + - label `update` goes in section "Updated" + - label `bug` goes in section "Fixed" + - label `docs` goes in section "Documentation" + - Default to section "Changed" + +With that in mind, when merging changes, it's a good idea to set the labels and rename the PR title to give a good summary of the change, in the context of the changelog. + +#### Limitations + +- Dependencies updates for the template repo (tox, cookiecutter, etc...) don't need to appear in changelog, and need to be labelled as `project infrastructure` manually. By default, they come from PyUp labelled as `update`. +- Dependabot updates for npm & Docker have a verbose title, try to rename them to be more readable: `Bump webpack-dev-server from 4.15.1 to 5.0.2 in /{{cookiecutter.project_slug}}` -> `Bump webpack-dev-server to 5.0.2` + +### Update contributors + +`update-contributors.yml` + +Runs on each push to master branch. List the 5 most recently merged pull requests and extract their author. If any of the authors is a new one, updates the `.github/contributors.json`, regenerate the `CONTRIBUTORS.md` from it, and push back the changes to master. + +#### Limitations + +- If you merge a pull request from a new contributor, and merge another one right after, the push to master will fail as the remote will be out of date. +- If you merge more than 5 pull requests in a row like this, the new contributor might fail to be added. diff --git a/scripts/update_contributors.py b/scripts/update_contributors.py index 09a7082c0..7f7b48d76 100644 --- a/scripts/update_contributors.py +++ b/scripts/update_contributors.py @@ -40,8 +40,8 @@ def iter_recent_authors(): """ Fetch users who opened recently merged pull requests. - Use Github API to fetch recent authors rather than - git CLI to work with Github usernames. + Use GitHub API to fetch recent authors rather than + git CLI to work with GitHub usernames. """ repo = Github(login_or_token=GITHUB_TOKEN, per_page=5).get_repo(GITHUB_REPO) recent_pulls = repo.get_pulls(state="closed", sort="updated", direction="desc").get_page(0) From 357604f37b0137e49e08e0e043c75cbf4457c366 Mon Sep 17 00:00:00 2001 From: Mounir Date: Fri, 23 Feb 2024 15:35:52 +0100 Subject: [PATCH 090/234] Install ruff extension in devcontainer.json (#4887) organizeImports is expecting a string. --- .../.devcontainer/devcontainer.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json b/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json index 7fcd62872..e16d06a20 100644 --- a/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json +++ b/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json @@ -35,7 +35,7 @@ "analysis.typeCheckingMode": "basic", "defaultInterpreterPath": "/usr/local/bin/python", "editor.codeActionsOnSave": { - "source.organizeImports": true + "source.organizeImports": "always" }, "editor.defaultFormatter": "charliermarsh.ruff", "languageServer": "Pylance", @@ -54,8 +54,7 @@ // python "ms-python.python", "ms-python.vscode-pylance", - "ms-python.isort", - "ms-python.black-formatter", + "charliermarsh.ruff", // django "batisteo.vscode-django" ] From 916f6666372bf5b1a61e2abe2b24f4e62294d5d3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 23 Feb 2024 14:36:31 +0000 Subject: [PATCH 091/234] 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 057309a52..785ee4b35 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1523,5 +1523,10 @@ "name": "Paul Wulff", "github_login": "mtmpaulwulff", "twitter_username": "" + }, + { + "name": "Mounir", + "github_login": "mounirmesselmeni", + "twitter_username": "" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 734900362..30064acb8 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1552,6 +1552,13 @@ Listed in alphabetical order. + + Mounir + + mounirmesselmeni + + + mozillazg From 4db3ea1e581be7d5792ea77326aa7cfb42d0548c Mon Sep 17 00:00:00 2001 From: Matthew Foster Walsh <15671892+mfosterw@users.noreply.github.com> Date: Fri, 23 Feb 2024 09:37:34 -0500 Subject: [PATCH 092/234] Switch to local imports within app (#4883) --- .../{{cookiecutter.project_slug}}/users/admin.py | 6 +++--- .../{{cookiecutter.project_slug}}/users/forms.py | 2 +- .../{{cookiecutter.project_slug}}/users/managers.py | 2 +- .../{{cookiecutter.project_slug}}/users/models.py | 2 +- .../{{cookiecutter.project_slug}}/users/tasks.py | 2 +- .../{{cookiecutter.project_slug}}/users/urls.py | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py index d0d1488f8..70f829256 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py @@ -4,9 +4,9 @@ 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 {{ cookiecutter.project_slug }}.users.forms import UserAdminChangeForm -from {{ cookiecutter.project_slug }}.users.forms import UserAdminCreationForm -from {{ cookiecutter.project_slug }}.users.models import User +from .forms import UserAdminChangeForm +from .forms import UserAdminCreationForm +from .models import User if settings.DJANGO_ADMIN_FORCE_ALLAUTH: # Force the `admin` sign in process to go through the `django-allauth` workflow: diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py index 2d18de208..830fca60d 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py @@ -6,7 +6,7 @@ from django.forms import EmailField {%- endif %} from django.utils.translation import gettext_lazy as _ -from {{ cookiecutter.project_slug }}.users.models import User +from .models import User class UserAdminChangeForm(admin_forms.UserChangeForm): diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py index c75c0e970..d8beaa48e 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py @@ -4,7 +4,7 @@ from django.contrib.auth.hashers import make_password from django.contrib.auth.models import UserManager as DjangoUserManager if TYPE_CHECKING: - from {{ cookiecutter.project_slug }}.users.models import User # noqa: F401 + from .models import User # noqa: F401 class UserManager(DjangoUserManager["User"]): diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py index fd78c26a8..4a870cc28 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py @@ -11,7 +11,7 @@ from django.urls import reverse from django.utils.translation import gettext_lazy as _ {%- if cookiecutter.username_type == "email" %} -from {{ cookiecutter.project_slug }}.users.managers import UserManager +from .managers import UserManager {%- endif %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py index 2afd4d4bd..ca51cd740 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py @@ -1,6 +1,6 @@ from celery import shared_task -from {{ cookiecutter.project_slug }}.users.models import User +from .models import User @shared_task() diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py index 40719ed21..74d65da1e 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py @@ -1,8 +1,8 @@ from django.urls import path -from {{ cookiecutter.project_slug }}.users.views import user_detail_view -from {{ cookiecutter.project_slug }}.users.views import user_redirect_view -from {{ cookiecutter.project_slug }}.users.views import user_update_view +from .views import user_detail_view +from .views import user_redirect_view +from .views import user_update_view app_name = "users" urlpatterns = [ From 0ca9be321ad3e3d67c65efcfad1521cab32f274a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 14:38:40 +0000 Subject: [PATCH 093/234] Bump webpack-dev-server to 5.0.2 (#4875) * Bump webpack-dev-server in /{{cookiecutter.project_slug}} Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 4.15.1 to 5.0.2. - [Release notes](https://github.com/webpack/webpack-dev-server/releases) - [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack/webpack-dev-server/compare/v4.15.1...v5.0.2) --- updated-dependencies: - dependency-name: webpack-dev-server dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Update server proxy syntax for webpack-dev-server@v5 --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bruno Alla --- {{cookiecutter.project_slug}}/package.json | 2 +- .../webpack/dev.config.js | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/{{cookiecutter.project_slug}}/package.json b/{{cookiecutter.project_slug}}/package.json index efa2136e5..9ca728208 100644 --- a/{{cookiecutter.project_slug}}/package.json +++ b/{{cookiecutter.project_slug}}/package.json @@ -31,7 +31,7 @@ "webpack": "^5.65.0", "webpack-bundle-tracker": "^3.0.1", "webpack-cli": "^5.0.1", - "webpack-dev-server": "^4.6.0", + "webpack-dev-server": "^5.0.2", "webpack-merge": "^5.8.0" }, "engines": { diff --git a/{{cookiecutter.project_slug}}/webpack/dev.config.js b/{{cookiecutter.project_slug}}/webpack/dev.config.js index 8276c3489..7c774185e 100644 --- a/{{cookiecutter.project_slug}}/webpack/dev.config.js +++ b/{{cookiecutter.project_slug}}/webpack/dev.config.js @@ -6,13 +6,16 @@ module.exports = merge(commonConfig, { devtool: 'inline-source-map', devServer: { port: 3000, - proxy: { - {%- if cookiecutter.use_docker == 'n' %} - '/': 'http://0.0.0.0:8000', - {%- else %} - '/': 'http://django:8000', - {%- endif %} - }, + proxy: [ + { + context: ['/'], + {%- if cookiecutter.use_docker == 'n' %} + target: 'http://0.0.0.0:8000', + {%- else %} + target: 'http://django:8000', + {%- endif %} + }, + ], client: { overlay: { errors: true, From 37f974157bc5a8b59585c99c62de35e03b9e0358 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 23 Feb 2024 15:43:30 +0100 Subject: [PATCH 094/234] Switch to dependabot for template & docs deps updates This enables us to use a separate label --- .github/dependabot.yml | 16 ++++++++++++++++ .pyup.yml | 2 -- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e6590469a..3582a2125 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,6 +3,22 @@ version: 2 updates: + # Update Python deps for the template (not the generated project) + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + labels: + - "project infrastructure" + + # Update Python deps for the documentation + - package-ecosystem: "pip" + directory: "docs/" + schedule: + interval: "daily" + labels: + - "project infrastructure" + # Update GitHub actions in workflows - package-ecosystem: "github-actions" directory: "/" diff --git a/.pyup.yml b/.pyup.yml index e5d4752e4..13d336d57 100644 --- a/.pyup.yml +++ b/.pyup.yml @@ -14,8 +14,6 @@ pin: True label_prs: update requirements: - - "requirements.txt" - - "docs/requirements.txt" - "{{cookiecutter.project_slug}}/requirements/base.txt" - "{{cookiecutter.project_slug}}/requirements/local.txt" - "{{cookiecutter.project_slug}}/requirements/production.txt" From 899a1915cd5b73a8e57ef1e083babd6d73fdf06d Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 23 Feb 2024 15:53:03 +0100 Subject: [PATCH 095/234] Add paragraph about automated updates --- docs/maintainer-guide.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/maintainer-guide.md b/docs/maintainer-guide.md index 508918abe..9baac688a 100644 --- a/docs/maintainer-guide.md +++ b/docs/maintainer-guide.md @@ -2,6 +2,17 @@ This document is intended for maintainers of the template. +## Automated updates + +We use 2 separate services to keep our dependencies up-to-date: + +- Dependabot, which manages updates of Python deps of the template, GitHub actions, npm packages and Docker images. +- PyUp, which manages the Python deps for the generated project. + +We don't use Dependabot for the generated project deps because our requirements files are templated, and Dependabot fails to parse them. PyUp is -AFAIK- the only service out there that supports having Jinja tags in the requirements file. + +Updates for the template should be labelled as `project infrastructure` while the ones about the generated project should be labelled as `update`. This is use to work in conjunction with our changelog script (see later). + ## Automation scripts We have a few workflows which have been automated over time. They usually run using GitHub actions and might need a few small manual actions to work nicely. Some have a few limitations which we should document here. @@ -78,8 +89,8 @@ With that in mind, when merging changes, it's a good idea to set the labels and #### Limitations -- Dependencies updates for the template repo (tox, cookiecutter, etc...) don't need to appear in changelog, and need to be labelled as `project infrastructure` manually. By default, they come from PyUp labelled as `update`. - Dependabot updates for npm & Docker have a verbose title, try to rename them to be more readable: `Bump webpack-dev-server from 4.15.1 to 5.0.2 in /{{cookiecutter.project_slug}}` -> `Bump webpack-dev-server to 5.0.2` +- ~~Dependencies updates for the template repo (tox, cookiecutter, etc...) don't need to appear in changelog, and need to be labelled as `project infrastructure` manually. By default, they come from PyUp labelled as `update`.~~ ### Update contributors From 91ebf6f95b02ea0dba7603d14066bdfe877c7925 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 24 Feb 2024 02:08:16 +0000 Subject: [PATCH 096/234] Release 2024.02.23 --- CHANGELOG.md | 13 +++++++++++++ setup.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8ad3f6bf..088e814c0 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.02.23 + + +### Changed + +- Switch to local imports within app ([#4883](https://github.com/cookiecutter/cookiecutter-django/pull/4883)) + +- Install ruff extension in `devcontainer.json` ([#4887](https://github.com/cookiecutter/cookiecutter-django/pull/4887)) + +### Updated + +- Bump webpack-dev-server to 5.0.2 ([#4875](https://github.com/cookiecutter/cookiecutter-django/pull/4875)) + ## 2024.02.21 diff --git a/setup.py b/setup.py index 62b38573d..f7947b0e7 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.02.21" +version = "2024.02.23" with open("README.md") as readme_file: long_description = readme_file.read() From ddf18527687f7d9fca0731d197f8feee3d3d8618 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 24 Feb 2024 04:50:30 -0800 Subject: [PATCH 097/234] Update coverage from 7.4.1 to 7.4.3 (#4888) --- {{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 8225dab0f..618226f6d 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -29,7 +29,7 @@ sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ ruff==0.2.2 # https://github.com/astral-sh/ruff -coverage==7.4.1 # https://github.com/nedbat/coveragepy +coverage==7.4.3 # https://github.com/nedbat/coveragepy djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pre-commit==3.6.2 # https://github.com/pre-commit/pre-commit From 052330272acfd4eba473fcc05e80e32e1abbbe92 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 24 Feb 2024 18:14:52 +0100 Subject: [PATCH 098/234] Bump Heroku Python version to 3.11.8 --- {{cookiecutter.project_slug}}/runtime.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/runtime.txt b/{{cookiecutter.project_slug}}/runtime.txt index 1f79d441f..cf3b80423 100644 --- a/{{cookiecutter.project_slug}}/runtime.txt +++ b/{{cookiecutter.project_slug}}/runtime.txt @@ -1 +1 @@ -python-3.11.7 +python-3.11.8 From 2c93ef4009a583da58d9b3272511a38a48d3c0cc Mon Sep 17 00:00:00 2001 From: Jelmer Draaijer Date: Sat, 24 Feb 2024 19:31:34 +0100 Subject: [PATCH 099/234] Entrance justify-content-center with a sice of md-4 --- .../templates/allauth/layouts/entrance.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html index 2632f3c56..156a6e930 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html @@ -9,8 +9,8 @@ {% endblock head_title %} {% endblock title %} {% block body %} -
-
+
+
{% block content %} {% endblock content %}
From 0e41e5e8d047bb565a7e7c9a22f9804d1459e1b7 Mon Sep 17 00:00:00 2001 From: Jelmer Draaijer Date: Sat, 24 Feb 2024 19:32:56 +0100 Subject: [PATCH 100/234] Added messages to entrance page --- .../templates/allauth/layouts/entrance.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html index 156a6e930..91cbaba3f 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html @@ -11,6 +11,17 @@ {% block body %}
+ {% if messages %} + {% for message in messages %} +
+ {{ message }} + +
+ {% endfor %} + {% endif %} {% block content %} {% endblock content %}
From c3708c080981349e3e728a4284de1685424649f3 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 25 Feb 2024 02:12:02 +0000 Subject: [PATCH 101/234] Release 2024.02.24 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 088e814c0..2c8430927 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.02.24 + + +### Updated + +- Update coverage to 7.4.3 ([#4888](https://github.com/cookiecutter/cookiecutter-django/pull/4888)) + ## 2024.02.23 diff --git a/setup.py b/setup.py index f7947b0e7..f5a26920f 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.02.23" +version = "2024.02.24" with open("README.md") as readme_file: long_description = readme_file.read() From 56f630bae6bccaf6cfd34c5b1c30eaf1e5fd3c33 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 25 Feb 2024 02:12:07 +0000 Subject: [PATCH 102/234] Update pytest from 8.0.1 to 8.0.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 138744a26..70bc7df81 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ pre-commit==3.6.2 # Testing # ------------------------------------------------------------------------------ tox==4.13.0 -pytest==8.0.1 +pytest==8.0.2 pytest-xdist==3.5.0 pytest-cookies==0.7.0 pytest-instafail==0.5.0 From c7872e6c0fc7a8ac4b27de2903b9f385461098d1 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 25 Feb 2024 02:12:07 +0000 Subject: [PATCH 103/234] Update pytest from 8.0.1 to 8.0.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 618226f6d..0de14977a 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.7.1 # https://github.com/python/mypy django-stubs[compatible-mypy]==4.2.7 # https://github.com/typeddjango/django-stubs -pytest==8.0.1 # https://github.com/pytest-dev/pytest +pytest==8.0.2 # 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 From 5f2c9e6e409a55a8d64a65aa5f55890b50fe5197 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 25 Feb 2024 09:38:31 +0000 Subject: [PATCH 104/234] Update crispy-bootstrap5 from 2023.10 to 2024.2 --- {{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 f090018ef..5ad49607d 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -33,7 +33,7 @@ django-environ==0.11.2 # https://github.com/joke2k/django-environ django-model-utils==4.4.0 # https://github.com/jazzband/django-model-utils django-allauth==0.61.1 # https://github.com/pennersr/django-allauth django-crispy-forms==2.1 # https://github.com/django-crispy-forms/django-crispy-forms -crispy-bootstrap5==2023.10 # https://github.com/django-crispy-forms/crispy-bootstrap5 +crispy-bootstrap5==2024.2 # https://github.com/django-crispy-forms/crispy-bootstrap5 {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} django-compressor==4.4 # https://github.com/django-compressor/django-compressor {%- endif %} From 1174889779c7569c5516d89bf5d479b84587ee9d Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 27 Feb 2024 02:09:36 +0000 Subject: [PATCH 105/234] Release 2024.02.26 --- CHANGELOG.md | 13 +++++++++++++ setup.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c8430927..42cce9d2f 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.02.26 + + +### Changed + +- Allauth elements & MFA ([#4843](https://github.com/cookiecutter/cookiecutter-django/pull/4843)) + +### Updated + +- Update pytest to 8.0.2 ([#4890](https://github.com/cookiecutter/cookiecutter-django/pull/4890)) + +- Update crispy-bootstrap5 to 2024.2 ([#4891](https://github.com/cookiecutter/cookiecutter-django/pull/4891)) + ## 2024.02.24 diff --git a/setup.py b/setup.py index f5a26920f..8c2374049 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.02.24" +version = "2024.02.26" with open("README.md") as readme_file: long_description = readme_file.read() From f86df89db9b34d8ede8cb8c348cddc293d9ed70a Mon Sep 17 00:00:00 2001 From: Reggie Riser Date: Tue, 27 Feb 2024 14:53:12 -0500 Subject: [PATCH 106/234] Fixed invalid HTML in django-allauth field element template --- .../templates/allauth/elements/field.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/field.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/field.html index 1ed9309a2..8585f7a4d 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/field.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/field.html @@ -33,7 +33,7 @@ {% if attrs.autocomplete %}autocomplete="{{ attrs.autocomplete }}"{% endif %} value="{{ attrs.value|default_if_none:"" }}" type="{{ attrs.type }}" /> -
{% endif %} {% if slots.help_text %} -
{% slot help_text %}
-{% endslot %} +
{% slot help_text %}{% endslot %}
{% endif %}{% endraw %} From 81a1fc8a38e94c3b19ce617c812574179beedba8 Mon Sep 17 00:00:00 2001 From: JAEGYUN JUNG Date: Wed, 28 Feb 2024 18:36:39 +0900 Subject: [PATCH 107/234] Fix broken "Two scoops of django" link in FAQ (#4892) --- docs/faq.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index 52a99467c..9f0b52a7d 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -22,6 +22,6 @@ TODO 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 1.11`_. 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. +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 1.11: https://www.feldroy.com/collections/django/products/two-scoops-of-django-1-11 +.. _Two Scoops of Django 3.x: https://www.feldroy.com/books/two-scoops-of-django-3-x From f617433bac2b6ca29cc969ce9180048e1b942121 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 28 Feb 2024 09:37:18 +0000 Subject: [PATCH 108/234] 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 785ee4b35..534cee5bd 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1528,5 +1528,10 @@ "name": "Mounir", "github_login": "mounirmesselmeni", "twitter_username": "" + }, + { + "name": "JAEGYUN JUNG", + "github_login": "TGoddessana", + "twitter_username": "" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 30064acb8..e4edad3f7 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1048,6 +1048,13 @@ Listed in alphabetical order. + + JAEGYUN JUNG + + TGoddessana + + + Jakub Boukal From 95e5598dfd07bdd6fb0bc898354411c29879ce29 Mon Sep 17 00:00:00 2001 From: Simeon Emanuilov Date: Wed, 28 Feb 2024 11:41:08 +0200 Subject: [PATCH 109/234] Fix permissions for media files when served by nginx (#4889) chore: adding recursive flag for the WORKDIR directory --- .../compose/production/django/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index fb7fec50f..8c000016a 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -117,7 +117,7 @@ COPY --chown=django:django . ${APP_HOME} {%- endif %} # make django owner of the WORKDIR directory as well. -RUN chown django:django ${APP_HOME} +RUN chown -R django:django ${APP_HOME} USER django From ebb6c8b22509096efee343604d9790a75ffd0f58 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 28 Feb 2024 09:41:45 +0000 Subject: [PATCH 110/234] 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 534cee5bd..b47a56246 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1533,5 +1533,10 @@ "name": "JAEGYUN JUNG", "github_login": "TGoddessana", "twitter_username": "" + }, + { + "name": "Simeon Emanuilov", + "github_login": "s-emanuilov", + "twitter_username": "s_emanuilov" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index e4edad3f7..c14c0ea3b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1846,6 +1846,13 @@ Listed in alphabetical order. shywn_mrk + + Simeon Emanuilov + + s-emanuilov + + s_emanuilov + Simon Rey From 93e5e16fc2d73a78bcc9da3caad458a6dcde8b4b Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 28 Feb 2024 01:42:30 -0800 Subject: [PATCH 111/234] Update sentry-sdk to 1.40.6 (#4893) --- {{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 4d96e86e1..d813a8fc4 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==1.40.5 # https://github.com/getsentry/sentry-python +sentry-sdk==1.40.6 # 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 e72da846f2413c99a06967a0b090b57273f7f49c Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 28 Feb 2024 06:47:46 -0800 Subject: [PATCH 112/234] Update redis to 5.0.2 (#4895) --- {{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 ea0524ebd..eb0d961e8 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -11,7 +11,7 @@ argon2-cffi==23.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==6.6.0 # https://github.com/evansd/whitenoise {%- endif %} -redis==5.0.1 # https://github.com/redis/redis-py +redis==5.0.2 # https://github.com/redis/redis-py {%- if cookiecutter.use_docker == "y" or cookiecutter.windows == "n" %} hiredis==2.3.2 # https://github.com/redis/hiredis-py {%- endif %} From b0cfbc35b125541bf4cc91d7aa746331d4d6dfd2 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 29 Feb 2024 02:09:01 +0000 Subject: [PATCH 113/234] Release 2024.02.28 --- CHANGELOG.md | 19 +++++++++++++++++++ setup.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42cce9d2f..a4d4c3734 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,25 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.02.28 + + +### Fixed + +- Fix invalid HTML in django-allauth field element template ([#4894](https://github.com/cookiecutter/cookiecutter-django/pull/4894)) + +- Fix permissions for media files when served by nginx ([#4889](https://github.com/cookiecutter/cookiecutter-django/pull/4889)) + +### Documentation + +- Fix broken "Two scoops of django" link in FAQ ([#4892](https://github.com/cookiecutter/cookiecutter-django/pull/4892)) + +### Updated + +- Update redis to 5.0.2 ([#4895](https://github.com/cookiecutter/cookiecutter-django/pull/4895)) + +- Update sentry-sdk to 1.40.6 ([#4893](https://github.com/cookiecutter/cookiecutter-django/pull/4893)) + ## 2024.02.26 diff --git a/setup.py b/setup.py index 8c2374049..c5925976d 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.02.26" +version = "2024.02.28" with open("README.md") as readme_file: long_description = readme_file.read() From 46c0c51c520ed938ff08e6e2310aa993de505134 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 29 Feb 2024 15:44:35 +0000 Subject: [PATCH 114/234] Update ruff from 0.2.2 to 0.3.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 70bc7df81..be7416bd1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -ruff==0.2.2 +ruff==0.3.0 django-upgrade==1.16.0 djlint==1.34.1 pre-commit==3.6.2 From 48fadda99a54fe156c49699f45ebf12fe79c6224 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 29 Feb 2024 15:44:35 +0000 Subject: [PATCH 115/234] Update ruff from 0.2.2 to 0.3.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 0de14977a..fc39202cd 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -28,7 +28,7 @@ sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ -ruff==0.2.2 # https://github.com/astral-sh/ruff +ruff==0.3.0 # https://github.com/astral-sh/ruff coverage==7.4.3 # https://github.com/nedbat/coveragepy djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pre-commit==3.6.2 # https://github.com/pre-commit/pre-commit From 4887b921481e805e15af952e8fc1a4457a980acb Mon Sep 17 00:00:00 2001 From: browniebroke <861044+browniebroke@users.noreply.github.com> Date: Fri, 1 Mar 2024 02:24:13 +0000 Subject: [PATCH 116/234] Auto-update pre-commit hooks --- {{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 1d06c042f..d95f5390d 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.2.2 + rev: v0.3.0 hooks: # Linter - id: ruff From fa44078ca654225f9285e1a95ab7eb3d5c5bd1ae Mon Sep 17 00:00:00 2001 From: Jakub Boukal Date: Fri, 1 Mar 2024 13:31:04 +0100 Subject: [PATCH 117/234] Add documentation to upgrade Postgres in Docker environment. Fixes: #461 --- docs/docker-postgres-backups.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/docker-postgres-backups.rst b/docs/docker-postgres-backups.rst index fdf446030..302e4c4b8 100644 --- a/docs/docker-postgres-backups.rst +++ b/docs/docker-postgres-backups.rst @@ -104,3 +104,24 @@ 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 + + +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 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 From 22d927ed1767361a5139f787ee51e7bf9a96332e Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 2 Mar 2024 02:08:19 +0000 Subject: [PATCH 118/234] Release 2024.03.01 --- CHANGELOG.md | 13 +++++++++++++ setup.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4d4c3734..e8d825295 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.03.01 + + +### Changed + +- Add a maintainer guide to the docs ([#4884](https://github.com/cookiecutter/cookiecutter-django/pull/4884)) + +### Updated + +- Auto-update pre-commit hooks ([#4897](https://github.com/cookiecutter/cookiecutter-django/pull/4897)) + +- Update ruff to 0.3.0 ([#4896](https://github.com/cookiecutter/cookiecutter-django/pull/4896)) + ## 2024.02.28 diff --git a/setup.py b/setup.py index c5925976d..db90aae34 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.02.28" +version = "2024.03.01" with open("README.md") as readme_file: long_description = readme_file.read() From 6d6f037b07b710dafba333dfe7eb287871361b52 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 3 Mar 2024 10:56:41 -0800 Subject: [PATCH 119/234] Update django-celery-beat from 2.5.0 to 2.6.0 (#4899) --- {{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 eb0d961e8..6fe3628de 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -17,7 +17,7 @@ hiredis==2.3.2 # https://github.com/redis/hiredis-py {%- endif %} {%- if cookiecutter.use_celery == "y" %} celery==5.3.6 # pyup: < 6.0 # https://github.com/celery/celery -django-celery-beat==2.5.0 # https://github.com/celery/django-celery-beat +django-celery-beat==2.6.0 # https://github.com/celery/django-celery-beat {%- if cookiecutter.use_docker == 'y' %} flower==2.0.1 # https://github.com/mher/flower {%- endif %} From 3d4dcee35637e22ed493537fe74baa18034b5604 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 4 Mar 2024 02:33:36 +0000 Subject: [PATCH 120/234] Release 2024.03.03 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8d825295..8cf537eb9 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.03.03 + + +### Updated + +- Update django-celery-beat to 2.6.0 ([#4899](https://github.com/cookiecutter/cookiecutter-django/pull/4899)) + ## 2024.03.01 diff --git a/setup.py b/setup.py index db90aae34..6e1ea0727 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.03.01" +version = "2024.03.03" with open("README.md") as readme_file: long_description = readme_file.read() From 2aff1bdb7531bd46724fba9b9787103c9989d5b8 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 4 Mar 2024 04:32:18 -0800 Subject: [PATCH 121/234] Update django to 4.2.11 (#4901) --- {{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 6fe3628de..3aad4c947 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -28,7 +28,7 @@ uvicorn[standard]==0.27.1 # https://github.com/encode/uvicorn # Django # ------------------------------------------------------------------------------ -django==4.2.10 # pyup: < 5.0 # https://www.djangoproject.com/ +django==4.2.11 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.11.2 # https://github.com/joke2k/django-environ django-model-utils==4.4.0 # https://github.com/jazzband/django-model-utils django-allauth[mfa]==0.61.1 # https://github.com/pennersr/django-allauth From 0b4e92739c3c03ccf35f891c1c0ed35c3c3e3b74 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 4 Mar 2024 04:36:36 -0800 Subject: [PATCH 122/234] Update pytest to 8.1.0 (#4900) * Update pytest from 8.0.2 to 8.1.0 * Update pytest from 8.0.2 to 8.1.0 --- 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 be7416bd1..4fcc7bb8c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ pre-commit==3.6.2 # Testing # ------------------------------------------------------------------------------ tox==4.13.0 -pytest==8.0.2 +pytest==8.1.0 pytest-xdist==3.5.0 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 fc39202cd..4acd2c4dd 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.7.1 # https://github.com/python/mypy django-stubs[compatible-mypy]==4.2.7 # https://github.com/typeddjango/django-stubs -pytest==8.0.2 # https://github.com/pytest-dev/pytest +pytest==8.1.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 From f1da6ba5f507bf62af5a1d2a7deb54deab5c2eab Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 5 Mar 2024 02:09:53 +0000 Subject: [PATCH 123/234] Release 2024.03.04 --- CHANGELOG.md | 9 +++++++++ setup.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cf537eb9..102612443 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.03.04 + + +### Updated + +- Update pytest to 8.1.0 ([#4900](https://github.com/cookiecutter/cookiecutter-django/pull/4900)) + +- Update django to 4.2.11 ([#4901](https://github.com/cookiecutter/cookiecutter-django/pull/4901)) + ## 2024.03.03 diff --git a/setup.py b/setup.py index 6e1ea0727..93abfd33e 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.03.03" +version = "2024.03.04" with open("README.md") as readme_file: long_description = readme_file.read() From f39aff8b3feabed3d5c9e690a1e9df103daf02ef Mon Sep 17 00:00:00 2001 From: GitBib <15717621+GitBib@users.noreply.github.com> Date: Wed, 6 Mar 2024 05:50:01 -0800 Subject: [PATCH 124/234] Fix fully qualified docker images (#4905) * Fix Python (docker) Docker image version not being recognized after adding registry to image names * Fix Python (docs) Docker image version not being recognized after adding registry to image names * Fix Python (django) Docker image version not being recognized after adding registry to image names --- {{cookiecutter.project_slug}}/compose/local/django/Dockerfile | 4 ++-- {{cookiecutter.project_slug}}/compose/local/docs/Dockerfile | 4 ++-- .../compose/production/django/Dockerfile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index 75d5cbb9b..412865d26 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -2,7 +2,7 @@ FROM docker.io/python:3.11.8-slim-bookworm as python # Python build stage -FROM docker.io/python as python-build-stage +FROM python as python-build-stage ARG BUILD_ENVIRONMENT=local @@ -22,7 +22,7 @@ RUN pip wheel --wheel-dir /usr/src/app/wheels \ # Python 'run' stage -FROM docker.io/python as python-run-stage +FROM python as python-run-stage ARG BUILD_ENVIRONMENT=local ARG APP_HOME=/app diff --git a/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile index 87a1b2465..2b155f86d 100644 --- a/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile @@ -3,7 +3,7 @@ FROM docker.io/python:3.11.8-slim-bookworm as python # Python build stage -FROM docker.io/python as python-build-stage +FROM python as python-build-stage ENV PYTHONDONTWRITEBYTECODE 1 @@ -26,7 +26,7 @@ RUN pip wheel --no-cache-dir --wheel-dir /usr/src/app/wheels \ # Python 'run' stage -FROM docker.io/python as python-run-stage +FROM python as python-run-stage ARG BUILD_ENVIRONMENT ENV PYTHONUNBUFFERED 1 diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 8c000016a..05b18aa25 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -28,7 +28,7 @@ RUN npm run build FROM docker.io/python:3.11.8-slim-bookworm as python # Python build stage -FROM docker.io/python as python-build-stage +FROM python as python-build-stage ARG BUILD_ENVIRONMENT=production @@ -48,7 +48,7 @@ RUN pip wheel --wheel-dir /usr/src/app/wheels \ # Python 'run' stage -FROM docker.io/python as python-run-stage +FROM python as python-run-stage ARG BUILD_ENVIRONMENT=production ARG APP_HOME=/app From a11547f27e084463c98c29e8fd2839d9a2214e9a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 6 Mar 2024 06:01:23 -0800 Subject: [PATCH 125/234] Update tox to 4.14.0 (#4904) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4fcc7bb8c..7450f432e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ pre-commit==3.6.2 # Testing # ------------------------------------------------------------------------------ -tox==4.13.0 +tox==4.14.0 pytest==8.1.0 pytest-xdist==3.5.0 pytest-cookies==0.7.0 From 9e8931e25c0de4e456bc39acf43c5ee94581c362 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 7 Mar 2024 02:05:07 +0000 Subject: [PATCH 126/234] Release 2024.03.06 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 102612443..d08352b51 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.03.06 + + +### Fixed + +- Fix fully qualified docker images ([#4905](https://github.com/cookiecutter/cookiecutter-django/pull/4905)) + ## 2024.03.04 diff --git a/setup.py b/setup.py index 93abfd33e..8c3952f5f 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.03.04" +version = "2024.03.06" with open("README.md") as readme_file: long_description = readme_file.read() From 64cb0073f897cb5b3cde74922803e549cc3673a6 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 7 Mar 2024 14:10:53 -0800 Subject: [PATCH 127/234] Update sentry-sdk from 1.40.6 to 1.41.0 (#4908) --- {{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 d813a8fc4..9dacceea7 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==1.40.6 # https://github.com/getsentry/sentry-python +sentry-sdk==1.41.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 374915c6a111f18b463715f68bd8c76afb159ffd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 22:11:21 +0000 Subject: [PATCH 128/234] Auto-update pre-commit hooks (#4907) 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 d95f5390d..b42bc3b36 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.3.0 + rev: v0.3.1 hooks: # Linter - id: ruff From cc55c8c671828ae4c71ec37af2b6e045c87957f8 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 7 Mar 2024 14:12:16 -0800 Subject: [PATCH 129/234] Update tox from 4.14.0 to 4.14.1 (#4906) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 7450f432e..2f0eaff26 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ pre-commit==3.6.2 # Testing # ------------------------------------------------------------------------------ -tox==4.14.0 +tox==4.14.1 pytest==8.1.0 pytest-xdist==3.5.0 pytest-cookies==0.7.0 From b27fd26b782f489191a4baa5f33c85b92af89832 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 8 Mar 2024 02:09:57 +0000 Subject: [PATCH 130/234] Release 2024.03.07 --- CHANGELOG.md | 9 +++++++++ setup.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d08352b51..a8ea64eec 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.03.07 + + +### Updated + +- Auto-update pre-commit hooks ([#4907](https://github.com/cookiecutter/cookiecutter-django/pull/4907)) + +- Update sentry-sdk to 1.41.0 ([#4908](https://github.com/cookiecutter/cookiecutter-django/pull/4908)) + ## 2024.03.06 diff --git a/setup.py b/setup.py index 8c3952f5f..0c8d211fa 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.03.06" +version = "2024.03.07" with open("README.md") as readme_file: long_description = readme_file.read() From c561f51660be3ab3293cec4c2a04e974ae5d47b3 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 10 Mar 2024 10:39:29 -0700 Subject: [PATCH 131/234] Update pytest to 8.1.1 (#4914) * Update pytest from 8.1.0 to 8.1.1 * Update pytest from 8.1.0 to 8.1.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 2f0eaff26..4c680ccfc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ pre-commit==3.6.2 # Testing # ------------------------------------------------------------------------------ tox==4.14.1 -pytest==8.1.0 +pytest==8.1.1 pytest-xdist==3.5.0 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 4acd2c4dd..d4fa33917 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.7.1 # https://github.com/python/mypy django-stubs[compatible-mypy]==4.2.7 # https://github.com/typeddjango/django-stubs -pytest==8.1.0 # https://github.com/pytest-dev/pytest +pytest==8.1.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.14.5 # https://github.com/typeddjango/djangorestframework-stubs From cd9b5c020189271bf99fcecec67f4c683910c303 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 10 Mar 2024 10:40:41 -0700 Subject: [PATCH 132/234] Update redis from 5.0.2 to 5.0.3 (#4916) --- {{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 3aad4c947..2b770faaf 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -11,7 +11,7 @@ argon2-cffi==23.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==6.6.0 # https://github.com/evansd/whitenoise {%- endif %} -redis==5.0.2 # https://github.com/redis/redis-py +redis==5.0.3 # https://github.com/redis/redis-py {%- if cookiecutter.use_docker == "y" or cookiecutter.windows == "n" %} hiredis==2.3.2 # https://github.com/redis/hiredis-py {%- endif %} From 6c5ac37ed0631fbfe4a3e339f80b5a38a8f24b51 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 10 Mar 2024 10:41:01 -0700 Subject: [PATCH 133/234] Update uvicorn from 0.27.1 to 0.28.0 (#4913) --- {{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 2b770faaf..939a00f29 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -23,7 +23,7 @@ flower==2.0.1 # https://github.com/mher/flower {%- endif %} {%- endif %} {%- if cookiecutter.use_async == 'y' %} -uvicorn[standard]==0.27.1 # https://github.com/encode/uvicorn +uvicorn[standard]==0.28.0 # https://github.com/encode/uvicorn {%- endif %} # Django From a1541891ed7dfdd2f3f95c054a71f4f9f1d17343 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 10 Mar 2024 10:41:29 -0700 Subject: [PATCH 134/234] Update ruff to 0.3.2 (#4911) * Update ruff from 0.3.0 to 0.3.2 * Update ruff from 0.3.0 to 0.3.2 --- 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 4c680ccfc..ba8877d82 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -ruff==0.3.0 +ruff==0.3.2 django-upgrade==1.16.0 djlint==1.34.1 pre-commit==3.6.2 diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index d4fa33917..3e87dba73 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -28,7 +28,7 @@ sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ -ruff==0.3.0 # https://github.com/astral-sh/ruff +ruff==0.3.2 # https://github.com/astral-sh/ruff coverage==7.4.3 # https://github.com/nedbat/coveragepy djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pre-commit==3.6.2 # https://github.com/pre-commit/pre-commit From c1d580af489986de836a952d19ace444f9b34955 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 10 Mar 2024 17:41:39 +0000 Subject: [PATCH 135/234] Auto-update pre-commit hooks (#4912) 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 b42bc3b36..8d17d1b49 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.3.1 + rev: v0.3.2 hooks: # Linter - id: ruff From 2e9a9b02884390e4e2e0c941e2f9adeaccf6a716 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 11 Mar 2024 02:11:29 +0000 Subject: [PATCH 136/234] Release 2024.03.10 --- CHANGELOG.md | 15 +++++++++++++++ setup.py | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8ea64eec..d0d9599e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,21 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.03.10 + + +### Updated + +- Auto-update pre-commit hooks ([#4912](https://github.com/cookiecutter/cookiecutter-django/pull/4912)) + +- Update ruff to 0.3.2 ([#4911](https://github.com/cookiecutter/cookiecutter-django/pull/4911)) + +- Update uvicorn to 0.28.0 ([#4913](https://github.com/cookiecutter/cookiecutter-django/pull/4913)) + +- Update redis to 5.0.3 ([#4916](https://github.com/cookiecutter/cookiecutter-django/pull/4916)) + +- Update pytest to 8.1.1 ([#4914](https://github.com/cookiecutter/cookiecutter-django/pull/4914)) + ## 2024.03.07 diff --git a/setup.py b/setup.py index 0c8d211fa..a18c4adc3 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.03.07" +version = "2024.03.10" with open("README.md") as readme_file: long_description = readme_file.read() From 93024ca941d9fc29895d0f26a1887ee45b716261 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 13 Mar 2024 14:06:22 +0000 Subject: [PATCH 137/234] Update sentry-sdk from 1.41.0 to 1.42.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 9dacceea7..6a7f34324 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==1.41.0 # https://github.com/getsentry/sentry-python +sentry-sdk==1.42.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 a406fde1af906ffbc48abf4193118365192f5133 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 15 Mar 2024 19:46:41 +0000 Subject: [PATCH 138/234] Update ruff from 0.3.2 to 0.3.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ba8877d82..48cacacc9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -ruff==0.3.2 +ruff==0.3.3 django-upgrade==1.16.0 djlint==1.34.1 pre-commit==3.6.2 From c76c14ace510fc70e712f45d1cbde192adb600ca Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 15 Mar 2024 19:46:41 +0000 Subject: [PATCH 139/234] Update ruff from 0.3.2 to 0.3.3 --- {{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 3e87dba73..9d1e347e7 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -28,7 +28,7 @@ sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ -ruff==0.3.2 # https://github.com/astral-sh/ruff +ruff==0.3.3 # https://github.com/astral-sh/ruff coverage==7.4.3 # https://github.com/nedbat/coveragepy djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pre-commit==3.6.2 # https://github.com/pre-commit/pre-commit From 7b1d5f15980fed3b6d8d2c1b0560af1a3b89e1ca Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 16 Mar 2024 22:22:40 +0000 Subject: [PATCH 140/234] Update djangorestframework from 3.14.0 to 3.15.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 939a00f29..94eae8790 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -40,7 +40,7 @@ django-compressor==4.4 # https://github.com/django-compressor/django-compressor django-redis==5.4.0 # https://github.com/jazzband/django-redis {%- if cookiecutter.use_drf == 'y' %} # Django REST Framework -djangorestframework==3.14.0 # https://github.com/encode/django-rest-framework +djangorestframework==3.15.0 # https://github.com/encode/django-rest-framework django-cors-headers==4.3.1 # https://github.com/adamchainz/django-cors-headers # DRF-spectacular for api documentation drf-spectacular==0.27.1 # https://github.com/tfranzel/drf-spectacular From 0ba5fc708de4793909e46c28f4a61b81b3191e6d Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 18 Mar 2024 02:10:30 +0000 Subject: [PATCH 141/234] Release 2024.03.17 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0d9599e5..80e5273a7 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.03.17 + + +### Updated + +- Update djangorestframework to 3.15.0 ([#4929](https://github.com/cookiecutter/cookiecutter-django/pull/4929)) + ## 2024.03.10 diff --git a/setup.py b/setup.py index a18c4adc3..7f55f00ab 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.03.10" +version = "2024.03.17" with open("README.md") as readme_file: long_description = readme_file.read() From ba4f3299ba352832db5d1556872b5869755409e8 Mon Sep 17 00:00:00 2001 From: browniebroke <861044+browniebroke@users.noreply.github.com> Date: Mon, 18 Mar 2024 02:23:15 +0000 Subject: [PATCH 142/234] Auto-update pre-commit hooks --- .pre-commit-config.yaml | 2 +- {{cookiecutter.project_slug}}/.pre-commit-config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6355c5ac7..f8c482d96 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: exclude: hooks/ - repo: https://github.com/psf/black - rev: 24.2.0 + rev: 24.3.0 hooks: - id: black diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 8d17d1b49..05a067720 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.3.2 + rev: v0.3.3 hooks: # Linter - id: ruff From 523b61ae7caf92ebb46eaa9f5d8f6472fa7ede01 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 18 Mar 2024 00:55:10 -0700 Subject: [PATCH 143/234] Update coverage from 7.4.3 to 7.4.4 (#4926) Co-authored-by: Jelmer --- {{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 9d1e347e7..6bae9a995 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -29,7 +29,7 @@ sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ ruff==0.3.3 # https://github.com/astral-sh/ruff -coverage==7.4.3 # https://github.com/nedbat/coveragepy +coverage==7.4.4 # https://github.com/nedbat/coveragepy djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pre-commit==3.6.2 # https://github.com/pre-commit/pre-commit From 5c71441c9bf1e22c910578f4caf0788a73b10515 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 18 Mar 2024 00:55:46 -0700 Subject: [PATCH 144/234] Update django-anymail to 10.3 (#4919) * Update django-anymail from 10.2 to 10.3 --- .../requirements/production.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 6a7f34324..d5f053c49 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -24,21 +24,21 @@ django-storages[google]==1.14.2 # https://github.com/jschneier/django-storages django-storages[azure]==1.14.2 # https://github.com/jschneier/django-storages {%- endif %} {%- if cookiecutter.mail_service == 'Mailgun' %} -django-anymail[mailgun]==10.2 # https://github.com/anymail/django-anymail +django-anymail[mailgun]==10.3 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Amazon SES' %} -django-anymail[amazon-ses]==10.2 # https://github.com/anymail/django-anymail +django-anymail[amazon-ses]==10.3 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Mailjet' %} -django-anymail[mailjet]==10.2 # https://github.com/anymail/django-anymail +django-anymail[mailjet]==10.3 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Mandrill' %} -django-anymail[mandrill]==10.2 # https://github.com/anymail/django-anymail +django-anymail[mandrill]==10.3 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Postmark' %} -django-anymail[postmark]==10.2 # https://github.com/anymail/django-anymail +django-anymail[postmark]==10.3 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Sendgrid' %} -django-anymail[sendgrid]==10.2 # https://github.com/anymail/django-anymail +django-anymail[sendgrid]==10.3 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'SendinBlue' %} -django-anymail[sendinblue]==10.2 # https://github.com/anymail/django-anymail +django-anymail[sendinblue]==10.3 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'SparkPost' %} -django-anymail[sparkpost]==10.2 # https://github.com/anymail/django-anymail +django-anymail[sparkpost]==10.3 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Other SMTP' %} -django-anymail==10.2 # https://github.com/anymail/django-anymail +django-anymail==10.3 # https://github.com/anymail/django-anymail {%- endif %} From b488056b63597f5a790ef263ec6e71d582c482f9 Mon Sep 17 00:00:00 2001 From: Jelmer Draaijer Date: Mon, 18 Mar 2024 19:55:00 +0100 Subject: [PATCH 145/234] Upgrade Python to version 3.12 --- .github/workflows/ci.yml | 6 +++--- .github/workflows/django-issue-checker.yml | 2 +- .github/workflows/pre-commit-autoupdate.yml | 2 +- .github/workflows/update-changelog.yml | 2 +- .github/workflows/update-contributors.yml | 2 +- .pre-commit-config.yaml | 4 ++-- .readthedocs.yaml | 2 +- CONTRIBUTING.md | 8 ++++---- README.md | 2 +- docs/deployment-on-pythonanywhere.rst | 2 +- docs/developing-locally.rst | 4 ++-- hooks/pre_gen_project.py | 2 +- pyproject.toml | 2 +- setup.py | 2 +- tox.ini | 2 +- {{cookiecutter.project_slug}}/.drone.yml | 4 ++-- {{cookiecutter.project_slug}}/.github/workflows/ci.yml | 4 ++-- {{cookiecutter.project_slug}}/.gitlab-ci.yml | 4 ++-- {{cookiecutter.project_slug}}/.pre-commit-config.yaml | 2 +- {{cookiecutter.project_slug}}/.readthedocs.yml | 2 +- {{cookiecutter.project_slug}}/.travis.yml | 4 ++-- .../compose/local/django/Dockerfile | 2 +- .../compose/local/docs/Dockerfile | 2 +- .../compose/production/django/Dockerfile | 2 +- {{cookiecutter.project_slug}}/pyproject.toml | 4 ++-- {{cookiecutter.project_slug}}/runtime.txt | 2 +- 26 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82f7887f2..1db462916 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" cache: pip - name: Install dependencies run: pip install -r requirements.txt @@ -56,7 +56,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" cache: pip - name: Install dependencies run: pip install -r requirements.txt @@ -100,7 +100,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" cache: pip cache-dependency-path: | requirements.txt diff --git a/.github/workflows/django-issue-checker.yml b/.github/workflows/django-issue-checker.yml index e1b36f292..2185da81b 100644 --- a/.github/workflows/django-issue-checker.yml +++ b/.github/workflows/django-issue-checker.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml index 0ad414398..c01cd5141 100644 --- a/.github/workflows/pre-commit-autoupdate.yml +++ b/.github/workflows/pre-commit-autoupdate.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - name: Install pre-commit run: pip install pre-commit diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index b0150507d..305a608df 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/update-contributors.yml b/.github/workflows/update-contributors.yml index 0cda836dc..e814039db 100644 --- a/.github/workflows/update-contributors.yml +++ b/.github/workflows/update-contributors.yml @@ -22,7 +22,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f8c482d96..20d2f9c9f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ exclude: "{{cookiecutter.project_slug}}|.github/contributors.json|CHANGELOG.md|C default_stages: [commit] default_language_version: - python: python3.11 + python: python3.12 repos: - repo: https://github.com/pre-commit/pre-commit-hooks @@ -29,7 +29,7 @@ repos: rev: v3.15.1 hooks: - id: pyupgrade - args: [--py311-plus] + args: [--py312-plus] exclude: hooks/ - repo: https://github.com/psf/black diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 4598ff77c..872e43a2e 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -8,7 +8,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.11" + python: "3.12" # Build documentation in the docs/ directory with Sphinx sphinx: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 94ecbdd7d..753e827aa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,20 +18,20 @@ This last step is very important, don't start developing from master, it'll caus ## Testing -You'll need to run the tests using Python 3.11. We recommend using [tox](https://tox.readthedocs.io/en/latest/) to run the tests. It will automatically create a fresh virtual environment and install our test dependencies, such as [pytest-cookies](https://pypi.python.org/pypi/pytest-cookies/) and [flake8](https://pypi.python.org/pypi/flake8/). +You'll need to run the tests using Python 3.12. We recommend using [tox](https://tox.readthedocs.io/en/latest/) to run the tests. It will automatically create a fresh virtual environment and install our test dependencies, such as [pytest-cookies](https://pypi.python.org/pypi/pytest-cookies/) and [flake8](https://pypi.python.org/pypi/flake8/). We'll also run the tests on GitHub actions when you send your pull request, but it's a good idea to run them locally before you send it. ### Installation -First, make sure that your version of Python is 3.11: +First, make sure that your version of Python is 3.12: ```bash $ python --version -Python 3.11.3 +Python 3.12.2 ``` -Any version that starts with 3.11 will do. If you need to install it, you can get it from [python.org](https://www.python.org/downloads/). +Any version that starts with 3.12 will do. If you need to install it, you can get it from [python.org](https://www.python.org/downloads/). Then install `tox`, if not already installed: diff --git a/README.md b/README.md index a9bf1990f..3141aed89 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ production-ready Django projects quickly. ## Features - For Django 4.2 -- Works with Python 3.11 +- Works with Python 3.12 - Renders Django projects with 100% starting test coverage - Twitter [Bootstrap](https://github.com/twbs/bootstrap) v5 - [12-Factor](https://12factor.net) based settings via [django-environ](https://github.com/joke2k/django-environ) diff --git a/docs/deployment-on-pythonanywhere.rst b/docs/deployment-on-pythonanywhere.rst index 2fa6a960c..726f325e2 100644 --- a/docs/deployment-on-pythonanywhere.rst +++ b/docs/deployment-on-pythonanywhere.rst @@ -37,7 +37,7 @@ Make sure your project is fully committed and pushed up to Bitbucket or Github o mkvirtualenv --python=/usr/bin/python3.10 my-project-name pip install -r requirements/production.txt # may take a few minutes -.. note:: We're creating the virtualenv using Python 3.10 (``--python=/usr/bin/python3.10```), although Cookiecutter Django generates a project for Python 3.11. This is because, at time of writing, PythonAnywhere only supports Python 3.10. It shouldn't be a problem, but if is, you may try changing the Python version to 3.11 and see if it works. If it does, please let us know, or even better, submit a pull request to update this section. +.. note:: We're creating the virtualenv using Python 3.10 (``--python=/usr/bin/python3.10```), although Cookiecutter Django generates a project for Python 3.12. This is because, at time of writing, PythonAnywhere only supports Python 3.10. It shouldn't be a problem, but if is, you may try changing the Python version to 3.12 and see if it works. If it does, please let us know, or even better, submit a pull request to update this section. Setting environment variables in the console -------------------------------------------- diff --git a/docs/developing-locally.rst b/docs/developing-locally.rst index 92379f4fd..f7191d27d 100644 --- a/docs/developing-locally.rst +++ b/docs/developing-locally.rst @@ -9,7 +9,7 @@ Setting Up Development Environment Make sure to have the following on your host: -* Python 3.11 +* Python 3.12 * PostgreSQL_. * Redis_, if using Celery * Cookiecutter_ @@ -18,7 +18,7 @@ First things first. #. Create a virtualenv: :: - $ python3.11 -m venv + $ python3.12 -m venv #. Activate the virtualenv you have just created: :: diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index 2956b9ab4..e58fd3541 100644 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -39,7 +39,7 @@ if "{{ cookiecutter.use_docker }}".lower() == "n": if python_major_version == 2: print( WARNING + "You're running cookiecutter under Python 2, but the generated " - "project requires Python 3.11+. Do you want to proceed (y/n)? " + TERMINATOR + "project requires Python 3.12+. Do you want to proceed (y/n)? " + TERMINATOR ) yes_options, no_options = frozenset(["y"]), frozenset(["n"]) while True: diff --git a/pyproject.toml b/pyproject.toml index 2a9f00b29..6e68762f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ norecursedirs = [ # ==== black ==== [tool.black] line-length = 119 -target-version = ['py311'] +target-version = ['py312'] # ==== isort ==== diff --git a/setup.py b/setup.py index 7f55f00ab..3b685a036 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ setup( "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development", ], diff --git a/tox.ini b/tox.ini index 903d5a53b..3b7a95088 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] skipsdist = true -envlist = py311,black-template +envlist = py312,black-template [testenv] deps = -rrequirements.txt diff --git a/{{cookiecutter.project_slug}}/.drone.yml b/{{cookiecutter.project_slug}}/.drone.yml index dc08bfbab..969374f79 100644 --- a/{{cookiecutter.project_slug}}/.drone.yml +++ b/{{cookiecutter.project_slug}}/.drone.yml @@ -13,7 +13,7 @@ environment: steps: - name: lint pull: if-not-exists - image: python:3.11 + image: python:3.12 environment: PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit volumes: @@ -36,7 +36,7 @@ steps: - docker-compose -f local.yml up -d - docker-compose -f local.yml run django pytest {%- else %} - image: python:3.11 + image: python:3.12 commands: - pip install -r requirements/local.txt - pytest diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index 414ee1e60..48dad257a 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.12' {%- if cookiecutter.open_source_license != 'Not open source' %} # Consider using pre-commit.ci for open source project @@ -84,7 +84,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.12' cache: pip cache-dependency-path: | requirements/base.txt diff --git a/{{cookiecutter.project_slug}}/.gitlab-ci.yml b/{{cookiecutter.project_slug}}/.gitlab-ci.yml index 350212003..984e36a2a 100644 --- a/{{cookiecutter.project_slug}}/.gitlab-ci.yml +++ b/{{cookiecutter.project_slug}}/.gitlab-ci.yml @@ -13,7 +13,7 @@ variables: precommit: stage: lint - image: python:3.11 + image: python:3.12 variables: PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit cache: @@ -40,7 +40,7 @@ pytest: script: - docker compose -f local.yml run django pytest {%- else %} - image: python:3.11 + image: python:3.12 tags: - python services: diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 05a067720..5b8cc3186 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -2,7 +2,7 @@ exclude: '^docs/|/migrations/|devcontainer.json' default_stages: [commit] default_language_version: - python: python3.11 + python: python3.12 repos: - repo: https://github.com/pre-commit/pre-commit-hooks diff --git a/{{cookiecutter.project_slug}}/.readthedocs.yml b/{{cookiecutter.project_slug}}/.readthedocs.yml index d5a8ef661..556438876 100644 --- a/{{cookiecutter.project_slug}}/.readthedocs.yml +++ b/{{cookiecutter.project_slug}}/.readthedocs.yml @@ -8,7 +8,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: '3.11' + python: '3.12' # Build documentation in the docs/ directory with Sphinx sphinx: diff --git a/{{cookiecutter.project_slug}}/.travis.yml b/{{cookiecutter.project_slug}}/.travis.yml index 78709191a..18f9c0525 100644 --- a/{{cookiecutter.project_slug}}/.travis.yml +++ b/{{cookiecutter.project_slug}}/.travis.yml @@ -2,7 +2,7 @@ dist: focal language: python python: - - "3.11" + - "3.12" services: - {% if cookiecutter.use_docker == 'y' %}docker{% else %}postgresql{% endif %} @@ -37,7 +37,7 @@ jobs: - sudo apt-get install -qq libsqlite3-dev libxml2 libxml2-dev libssl-dev libbz2-dev wget curl llvm language: python python: - - "3.11" + - "3.12" install: - pip install -r requirements/local.txt script: diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index 412865d26..d607550a3 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -1,5 +1,5 @@ # define an alias for the specific python version used in this file. -FROM docker.io/python:3.11.8-slim-bookworm as python +FROM docker.io/python:3.12.2-slim-bookworm as python # Python build stage FROM python as python-build-stage diff --git a/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile index 2b155f86d..c95fa6663 100644 --- a/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile @@ -1,5 +1,5 @@ # define an alias for the specific python version used in this file. -FROM docker.io/python:3.11.8-slim-bookworm as python +FROM docker.io/python:3.12.2-slim-bookworm as python # Python build stage diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 05b18aa25..ea4f1899d 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -25,7 +25,7 @@ RUN npm run build {%- endif %} # define an alias for the specific python version used in this file. -FROM docker.io/python:3.11.8-slim-bookworm as python +FROM docker.io/python:3.12.2-slim-bookworm as python # Python build stage FROM python as python-build-stage diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index a056c71c3..ed27e2c9e 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -18,7 +18,7 @@ plugins = ["django_coverage_plugin"] # ==== mypy ==== [tool.mypy] -python_version = "3.11" +python_version = "3.12" check_untyped_defs = true ignore_missing_imports = true warn_unused_ignores = true @@ -88,7 +88,7 @@ exclude = [ # Same as Django: https://github.com/cookiecutter/cookiecutter-django/issues/4792. line-length = 88 indent-width = 4 -target-version = "py311" +target-version = "py312" [tool.ruff.lint] select = [ diff --git a/{{cookiecutter.project_slug}}/runtime.txt b/{{cookiecutter.project_slug}}/runtime.txt index cf3b80423..6e797d468 100644 --- a/{{cookiecutter.project_slug}}/runtime.txt +++ b/{{cookiecutter.project_slug}}/runtime.txt @@ -1 +1 @@ -python-3.11.8 +python-3.12.2 From a1d34a08af5b530ed4d7ded875d76bb8b1a86e64 Mon Sep 17 00:00:00 2001 From: Shayan Karimi Date: Mon, 18 Mar 2024 22:56:18 +0330 Subject: [PATCH 146/234] Split the docs from local.yml and build the service in CI (#4909) * Split the docs from local.yml and build the service in CI * Change docs build in our CI docker tests --- docs/developing-locally-docker.rst | 7 +++++++ tests/test_docker.sh | 2 +- {{cookiecutter.project_slug}}/.drone.yml | 1 + .../.github/workflows/ci.yml | 1 + {{cookiecutter.project_slug}}/.gitlab-ci.yml | 1 + {{cookiecutter.project_slug}}/.travis.yml | 1 + {{cookiecutter.project_slug}}/docs.yml | 18 ++++++++++++++++++ {{cookiecutter.project_slug}}/local.yml | 15 --------------- 8 files changed, 30 insertions(+), 16 deletions(-) create mode 100644 {{cookiecutter.project_slug}}/docs.yml diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index a8f945adf..01970e469 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -65,6 +65,13 @@ To run in a detached (background) mode, just:: $ docker compose up -d +These commands don't run the docs service. In order to run docs service you can run:: + + $ docker compose -f docs.yml up + +To run the docs with local services just use:: + + $ docker compose -f local.yml -f 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. diff --git a/tests/test_docker.sh b/tests/test_docker.sh index c3cad3b37..96bf8662d 100755 --- a/tests/test_docker.sh +++ b/tests/test_docker.sh @@ -43,7 +43,7 @@ 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 local.yml run docs make html +docker compose -f docs.yml run docs make html # Run npm build script if package.json is present if [ -f "package.json" ] diff --git a/{{cookiecutter.project_slug}}/.drone.yml b/{{cookiecutter.project_slug}}/.drone.yml index dc08bfbab..ede0ac06d 100644 --- a/{{cookiecutter.project_slug}}/.drone.yml +++ b/{{cookiecutter.project_slug}}/.drone.yml @@ -32,6 +32,7 @@ steps: 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 diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index 414ee1e60..2319bc0a3 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -70,6 +70,7 @@ jobs: - name: Build the Stack run: docker compose -f local.yml build django + run: docker compose -f local.yml build docs - name: Run DB Migrations run: docker compose -f local.yml run --rm django python manage.py migrate diff --git a/{{cookiecutter.project_slug}}/.gitlab-ci.yml b/{{cookiecutter.project_slug}}/.gitlab-ci.yml index 350212003..04cebbf94 100644 --- a/{{cookiecutter.project_slug}}/.gitlab-ci.yml +++ b/{{cookiecutter.project_slug}}/.gitlab-ci.yml @@ -34,6 +34,7 @@ pytest: - docker:dind before_script: - docker compose -f local.yml build + - docker compose -f 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 diff --git a/{{cookiecutter.project_slug}}/.travis.yml b/{{cookiecutter.project_slug}}/.travis.yml index 78709191a..8d23fa742 100644 --- a/{{cookiecutter.project_slug}}/.travis.yml +++ b/{{cookiecutter.project_slug}}/.travis.yml @@ -20,6 +20,7 @@ jobs: - docker compose -v - docker -v - docker compose -f local.yml build + - docker compose -f 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 diff --git a/{{cookiecutter.project_slug}}/docs.yml b/{{cookiecutter.project_slug}}/docs.yml new file mode 100644 index 000000000..d9e50b928 --- /dev/null +++ b/{{cookiecutter.project_slug}}/docs.yml @@ -0,0 +1,18 @@ +version: '3' + +services: + docs: + image: {{ cookiecutter.project_slug }}_local_docs + container_name: {{ cookiecutter.project_slug }}_local_docs + build: + context: . + dockerfile: ./compose/local/docs/Dockerfile + env_file: + - ./.envs/.local/.django + volumes: + - ./docs:/docs:z + - ./config:/app/config:z + - ./{{ cookiecutter.project_slug }}:/app/{{ cookiecutter.project_slug }}:z + ports: + - '9000:9000' + command: /start-docs diff --git a/{{cookiecutter.project_slug}}/local.yml b/{{cookiecutter.project_slug}}/local.yml index d924b739f..cd2c7fad0 100644 --- a/{{cookiecutter.project_slug}}/local.yml +++ b/{{cookiecutter.project_slug}}/local.yml @@ -40,21 +40,6 @@ services: env_file: - ./.envs/.local/.postgres - docs: - image: {{ cookiecutter.project_slug }}_local_docs - container_name: {{ cookiecutter.project_slug }}_local_docs - build: - context: . - dockerfile: ./compose/local/docs/Dockerfile - env_file: - - ./.envs/.local/.django - volumes: - - ./docs:/docs:z - - ./config:/app/config:z - - ./{{ cookiecutter.project_slug }}:/app/{{ cookiecutter.project_slug }}:z - ports: - - '9000:9000' - command: /start-docs {%- if cookiecutter.use_mailpit == 'y' %} mailpit: From 88a90402a414a1a195bd592fe22a50cc74aa5c2f Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 19 Mar 2024 02:10:39 +0000 Subject: [PATCH 147/234] Release 2024.03.18 --- CHANGELOG.md | 19 +++++++++++++++++++ setup.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80e5273a7..c19931dc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,25 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.03.18 + + +### Changed + +- Split the docs from local.yml and build the service in CI ([#4909](https://github.com/cookiecutter/cookiecutter-django/pull/4909)) + +### Updated + +- Update django-anymail to 10.3 ([#4919](https://github.com/cookiecutter/cookiecutter-django/pull/4919)) + +- Update sentry-sdk to 1.42.0 ([#4921](https://github.com/cookiecutter/cookiecutter-django/pull/4921)) + +- Update coverage to 7.4.4 ([#4926](https://github.com/cookiecutter/cookiecutter-django/pull/4926)) + +- Update ruff to 0.3.3 ([#4927](https://github.com/cookiecutter/cookiecutter-django/pull/4927)) + +- Auto-update pre-commit hooks ([#4928](https://github.com/cookiecutter/cookiecutter-django/pull/4928)) + ## 2024.03.17 diff --git a/setup.py b/setup.py index 7f55f00ab..9b1e1e71c 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.03.17" +version = "2024.03.18" with open("README.md") as readme_file: long_description = readme_file.read() From 747a1b1502157c4f814dbe147954696f6691f22e Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 20 Mar 2024 02:10:14 +0000 Subject: [PATCH 148/234] Release 2024.03.19 --- CHANGELOG.md | 9 +++++++++ setup.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c19931dc0..ae0da713d 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.03.19 + + +### Changed + +- Add documentation to upgrade Postgres in Docker environment. Fix: #461 ([#4898](https://github.com/cookiecutter/cookiecutter-django/pull/4898)) + +- Upgrade Python to version 3.12 ([#4930](https://github.com/cookiecutter/cookiecutter-django/pull/4930)) + ## 2024.03.18 diff --git a/setup.py b/setup.py index 000391a13..04603d8f3 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.03.18" +version = "2024.03.19" with open("README.md") as readme_file: long_description = readme_file.read() From 2e8412521a8d79349842a8976149409858978bbc Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 20 Mar 2024 07:43:05 +0000 Subject: [PATCH 149/234] Update uvicorn from 0.28.0 to 0.29.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 94eae8790..258bf3c21 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -23,7 +23,7 @@ flower==2.0.1 # https://github.com/mher/flower {%- endif %} {%- endif %} {%- if cookiecutter.use_async == 'y' %} -uvicorn[standard]==0.28.0 # https://github.com/encode/uvicorn +uvicorn[standard]==0.29.0 # https://github.com/encode/uvicorn {%- endif %} # Django From 387f03e6737835cf8cb60719ec4ca51d786ed93e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 20 Mar 2024 14:03:56 +0000 Subject: [PATCH 150/234] Update sentry-sdk from 1.42.0 to 1.43.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 d5f053c49..e412bd0cc 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==1.42.0 # https://github.com/getsentry/sentry-python +sentry-sdk==1.43.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 ad6faa617df983e361cfaadee1cc177068bcd548 Mon Sep 17 00:00:00 2001 From: Nix Siow Date: Thu, 21 Mar 2024 23:00:32 +1000 Subject: [PATCH 151/234] Add PostgreSQL 16, remove Postgres 10 and 11 (#4935) Add support for PostgreSQL 16 and remove support for version 10 & 11 --- README.md | 13 ++++++------- cookiecutter.json | 2 +- docs/project-generation-options.rst | 11 +++++------ tests/test_cookiecutter_generation.py | 3 +-- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 3141aed89..995303b42 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ _These features can be enabled during initial project setup._ ## Constraints - Only maintained 3rd party libraries are used. -- Uses PostgreSQL everywhere: 10 - 15 ([MySQL fork](https://github.com/mabdullahadeel/cookiecutter-django-mysql) also available). +- Uses PostgreSQL everywhere: 12 - 16 ([MySQL fork](https://github.com/mabdullahadeel/cookiecutter-django-mysql) also available). - Environment variables for configuration (This won't work with Apache/mod_wsgi). ## Support this Project! @@ -133,12 +133,11 @@ Answer the prompts with your own desired [options](http://cookiecutter-django.re Choose from 1, 2, 3 [1]: 1 use_docker [n]: n Select postgresql_version: - 1 - 15 - 2 - 14 - 3 - 13 - 4 - 12 - 5 - 11 - 6 - 10 + 1 - 16 + 2 - 15 + 3 - 14 + 4 - 13 + 5 - 12 Choose from 1, 2, 3, 4, 5 [1]: 1 Select cloud_provider: 1 - AWS diff --git a/cookiecutter.json b/cookiecutter.json index e343617d1..4eeede9c0 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -18,7 +18,7 @@ "windows": "n", "editor": ["None", "PyCharm", "VS Code"], "use_docker": "n", - "postgresql_version": ["15", "14", "13", "12", "11", "10"], + "postgresql_version": ["16", "15", "14", "13", "12"], "cloud_provider": ["AWS", "GCP", "Azure", "None"], "mail_service": [ "Mailgun", diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index 967b42426..23c8e9178 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -66,12 +66,11 @@ use_docker: postgresql_version: Select a PostgreSQL_ version to use. The choices are: - 1. 15 - 2. 14 - 3. 13 - 4. 12 - 5. 11 - 6. 10 + 1. 16 + 2. 15 + 3. 14 + 4. 13 + 5. 12 cloud_provider: Select a cloud provider for static & media files. The choices are: diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index b744a986c..6b581b03a 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -57,12 +57,11 @@ SUPPORTED_COMBINATIONS = [ {"editor": "VS Code"}, {"use_docker": "y"}, {"use_docker": "n"}, + {"postgresql_version": "16"}, {"postgresql_version": "15"}, {"postgresql_version": "14"}, {"postgresql_version": "13"}, {"postgresql_version": "12"}, - {"postgresql_version": "11"}, - {"postgresql_version": "10"}, {"cloud_provider": "AWS", "use_whitenoise": "y"}, {"cloud_provider": "AWS", "use_whitenoise": "n"}, {"cloud_provider": "GCP", "use_whitenoise": "y"}, From 1a7e6a8414b8723ab2be4a48527c31aebd118e58 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 22 Mar 2024 02:10:09 +0000 Subject: [PATCH 152/234] Release 2024.03.21 --- CHANGELOG.md | 13 +++++++++++++ setup.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae0da713d..e70117ffe 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.03.21 + + +### Changed + +- Add PostgreSQL 16, remove Postgres 10 and 11 ([#4935](https://github.com/cookiecutter/cookiecutter-django/pull/4935)) + +### Updated + +- Update uvicorn to 0.29.0 ([#4933](https://github.com/cookiecutter/cookiecutter-django/pull/4933)) + +- Update sentry-sdk to 1.43.0 ([#4934](https://github.com/cookiecutter/cookiecutter-django/pull/4934)) + ## 2024.03.19 diff --git a/setup.py b/setup.py index 04603d8f3..f6e6a0999 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.03.19" +version = "2024.03.21" with open("README.md") as readme_file: long_description = readme_file.read() From f4362c7676466b59b14ddd3b5bf06091e6ade389 Mon Sep 17 00:00:00 2001 From: Eraldo Energy Date: Tue, 26 Mar 2024 15:47:02 +0000 Subject: [PATCH 153/234] Update mentions of psycopg in comments (#4947) --- {{cookiecutter.project_slug}}/compose/local/django/Dockerfile | 4 ++-- {{cookiecutter.project_slug}}/compose/local/docs/Dockerfile | 4 ++-- .../compose/production/django/Dockerfile | 4 ++-- {{cookiecutter.project_slug}}/utility/requirements-bionic.apt | 2 +- .../utility/requirements-bookworm.apt | 2 +- .../utility/requirements-bullseye.apt | 2 +- {{cookiecutter.project_slug}}/utility/requirements-buster.apt | 2 +- {{cookiecutter.project_slug}}/utility/requirements-focal.apt | 2 +- {{cookiecutter.project_slug}}/utility/requirements-jammy.apt | 2 +- {{cookiecutter.project_slug}}/utility/requirements-jessie.apt | 2 +- .../utility/requirements-stretch.apt | 2 +- {{cookiecutter.project_slug}}/utility/requirements-trusty.apt | 2 +- {{cookiecutter.project_slug}}/utility/requirements-xenial.apt | 2 +- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index d607550a3..0897ab95d 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -10,7 +10,7 @@ ARG BUILD_ENVIRONMENT=local RUN apt-get update && apt-get install --no-install-recommends -y \ # dependencies for building Python packages build-essential \ - # psycopg2 dependencies + # psycopg dependencies libpq-dev # Requirements are installed here to ensure they will be cached. @@ -47,7 +47,7 @@ RUN groupadd --gid 1000 dev-user \ # Install required system dependencies RUN apt-get update && apt-get install --no-install-recommends -y \ - # psycopg2 dependencies + # psycopg dependencies libpq-dev \ # Translations dependencies gettext \ diff --git a/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile index c95fa6663..9251effba 100644 --- a/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile @@ -10,7 +10,7 @@ ENV PYTHONDONTWRITEBYTECODE 1 RUN apt-get update && apt-get install --no-install-recommends -y \ # dependencies for building Python packages build-essential \ - # psycopg2 dependencies + # psycopg dependencies libpq-dev \ # cleaning up unused files && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ @@ -35,7 +35,7 @@ ENV PYTHONDONTWRITEBYTECODE 1 RUN apt-get update && apt-get install --no-install-recommends -y \ # To run the Makefile make \ - # psycopg2 dependencies + # psycopg dependencies libpq-dev \ # Translations dependencies gettext \ diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index ea4f1899d..19b2cb0aa 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -36,7 +36,7 @@ ARG BUILD_ENVIRONMENT=production RUN apt-get update && apt-get install --no-install-recommends -y \ # dependencies for building Python packages build-essential \ - # psycopg2 dependencies + # psycopg dependencies libpq-dev # Requirements are installed here to ensure they will be cached. @@ -65,7 +65,7 @@ RUN addgroup --system django \ # Install required system dependencies RUN apt-get update && apt-get install --no-install-recommends -y \ - # psycopg2 dependencies + # psycopg dependencies libpq-dev \ # Translations dependencies gettext \ diff --git a/{{cookiecutter.project_slug}}/utility/requirements-bionic.apt b/{{cookiecutter.project_slug}}/utility/requirements-bionic.apt index 1ca82b264..0e1a6572c 100644 --- a/{{cookiecutter.project_slug}}/utility/requirements-bionic.apt +++ b/{{cookiecutter.project_slug}}/utility/requirements-bionic.apt @@ -9,7 +9,7 @@ python3-dev ##Pillow, pylibmc zlib1g-dev -##Postgresql and psycopg2 dependencies +##Postgresql and psycopg dependencies libpq-dev ##Pillow dependencies diff --git a/{{cookiecutter.project_slug}}/utility/requirements-bookworm.apt b/{{cookiecutter.project_slug}}/utility/requirements-bookworm.apt index a4910eb6d..f24f6f3da 100644 --- a/{{cookiecutter.project_slug}}/utility/requirements-bookworm.apt +++ b/{{cookiecutter.project_slug}}/utility/requirements-bookworm.apt @@ -9,7 +9,7 @@ python3-dev ##Pillow, pylibmc zlib1g-dev -##Postgresql and psycopg2 dependencies +##Postgresql and psycopg dependencies libpq-dev ##Pillow dependencies diff --git a/{{cookiecutter.project_slug}}/utility/requirements-bullseye.apt b/{{cookiecutter.project_slug}}/utility/requirements-bullseye.apt index 60f602873..e8e36b631 100644 --- a/{{cookiecutter.project_slug}}/utility/requirements-bullseye.apt +++ b/{{cookiecutter.project_slug}}/utility/requirements-bullseye.apt @@ -9,7 +9,7 @@ python3-dev ##Pillow, pylibmc zlib1g-dev -##Postgresql and psycopg2 dependencies +##Postgresql and psycopg dependencies libpq-dev ##Pillow dependencies diff --git a/{{cookiecutter.project_slug}}/utility/requirements-buster.apt b/{{cookiecutter.project_slug}}/utility/requirements-buster.apt index 75957f40d..f2c81962d 100644 --- a/{{cookiecutter.project_slug}}/utility/requirements-buster.apt +++ b/{{cookiecutter.project_slug}}/utility/requirements-buster.apt @@ -9,7 +9,7 @@ python3-dev ##Pillow, pylibmc zlib1g-dev -##Postgresql and psycopg2 dependencies +##Postgresql and psycopg dependencies libpq-dev ##Pillow dependencies diff --git a/{{cookiecutter.project_slug}}/utility/requirements-focal.apt b/{{cookiecutter.project_slug}}/utility/requirements-focal.apt index fe6f21e46..f400b4196 100644 --- a/{{cookiecutter.project_slug}}/utility/requirements-focal.apt +++ b/{{cookiecutter.project_slug}}/utility/requirements-focal.apt @@ -9,7 +9,7 @@ python3-dev ##Pillow, pylibmc zlib1g-dev -##Postgresql and psycopg2 dependencies +##Postgresql and psycopg dependencies libpq-dev ##Pillow dependencies diff --git a/{{cookiecutter.project_slug}}/utility/requirements-jammy.apt b/{{cookiecutter.project_slug}}/utility/requirements-jammy.apt index 63d1587e6..ea52472a1 100644 --- a/{{cookiecutter.project_slug}}/utility/requirements-jammy.apt +++ b/{{cookiecutter.project_slug}}/utility/requirements-jammy.apt @@ -9,7 +9,7 @@ python3-dev ##Pillow, pylibmc zlib1g-dev -##Postgresql and psycopg2 dependencies +##Postgresql and psycopg dependencies libpq-dev ##Pillow dependencies diff --git a/{{cookiecutter.project_slug}}/utility/requirements-jessie.apt b/{{cookiecutter.project_slug}}/utility/requirements-jessie.apt index 5c49365ba..ebf0e583e 100644 --- a/{{cookiecutter.project_slug}}/utility/requirements-jessie.apt +++ b/{{cookiecutter.project_slug}}/utility/requirements-jessie.apt @@ -9,7 +9,7 @@ python3-dev ##Pillow, pylibmc zlib1g-dev -##Postgresql and psycopg2 dependencies +##Postgresql and psycopg dependencies libpq-dev ##Pillow dependencies diff --git a/{{cookiecutter.project_slug}}/utility/requirements-stretch.apt b/{{cookiecutter.project_slug}}/utility/requirements-stretch.apt index a2b3a7e5e..979eca313 100644 --- a/{{cookiecutter.project_slug}}/utility/requirements-stretch.apt +++ b/{{cookiecutter.project_slug}}/utility/requirements-stretch.apt @@ -9,7 +9,7 @@ python3-dev ##Pillow, pylibmc zlib1g-dev -##Postgresql and psycopg2 dependencies +##Postgresql and psycopg dependencies libpq-dev ##Pillow dependencies diff --git a/{{cookiecutter.project_slug}}/utility/requirements-trusty.apt b/{{cookiecutter.project_slug}}/utility/requirements-trusty.apt index 455f1a868..954f78375 100644 --- a/{{cookiecutter.project_slug}}/utility/requirements-trusty.apt +++ b/{{cookiecutter.project_slug}}/utility/requirements-trusty.apt @@ -9,7 +9,7 @@ python3-dev ##Pillow, pylibmc zlib1g-dev -##Postgresql and psycopg2 dependencies +##Postgresql and psycopg dependencies libpq-dev ##Pillow dependencies diff --git a/{{cookiecutter.project_slug}}/utility/requirements-xenial.apt b/{{cookiecutter.project_slug}}/utility/requirements-xenial.apt index ba84ef167..1784e40c6 100644 --- a/{{cookiecutter.project_slug}}/utility/requirements-xenial.apt +++ b/{{cookiecutter.project_slug}}/utility/requirements-xenial.apt @@ -9,7 +9,7 @@ python3-dev ##Pillow, pylibmc zlib1g-dev -##Postgresql and psycopg2 dependencies +##Postgresql and psycopg dependencies libpq-dev ##Pillow dependencies From c616a03632654a33b8d898364e4641b7b76d22dc Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 27 Mar 2024 02:10:43 +0000 Subject: [PATCH 154/234] Release 2024.03.26 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e70117ffe..a174475ee 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.03.26 + + +### Documentation + +- Update mentions of psycopg in comments ([#4947](https://github.com/cookiecutter/cookiecutter-django/pull/4947)) + ## 2024.03.21 diff --git a/setup.py b/setup.py index f6e6a0999..c9b67d80a 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.03.21" +version = "2024.03.26" with open("README.md") as readme_file: long_description = readme_file.read() From bf09d5614fab62da5b6b8affff87e886dfc9af58 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 08:18:48 +0000 Subject: [PATCH 155/234] Auto-update pre-commit hooks (#4937) Co-authored-by: browniebroke <861044+browniebroke@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- {{cookiecutter.project_slug}}/.pre-commit-config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 20d2f9c9f..9d0fd0f25 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,7 @@ repos: args: ["--tab-width", "2"] - repo: https://github.com/asottile/pyupgrade - rev: v3.15.1 + rev: v3.15.2 hooks: - id: pyupgrade args: [--py312-plus] diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 5b8cc3186..bed85ad77 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.3.3 + rev: v0.3.4 hooks: # Linter - id: ruff From 52b4a61d824ba57f62b43bbe64bd765736141c60 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 27 Mar 2024 01:19:05 -0700 Subject: [PATCH 156/234] Update ruff to 0.3.4 (#4936) * Update ruff from 0.3.3 to 0.3.4 * Update ruff from 0.3.3 to 0.3.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 48cacacc9..f92e1c897 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -ruff==0.3.3 +ruff==0.3.4 django-upgrade==1.16.0 djlint==1.34.1 pre-commit==3.6.2 diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 6bae9a995..829ea4445 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -28,7 +28,7 @@ sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ -ruff==0.3.3 # https://github.com/astral-sh/ruff +ruff==0.3.4 # https://github.com/astral-sh/ruff coverage==7.4.4 # https://github.com/nedbat/coveragepy djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pre-commit==3.6.2 # https://github.com/pre-commit/pre-commit From bd9181befae8c7c0913500c78f6fb6231a9d101e Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 27 Mar 2024 01:19:31 -0700 Subject: [PATCH 157/234] Update tox from 4.14.1 to 4.14.2 (#4940) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f92e1c897..77505f83e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ pre-commit==3.6.2 # Testing # ------------------------------------------------------------------------------ -tox==4.14.1 +tox==4.14.2 pytest==8.1.1 pytest-xdist==3.5.0 pytest-cookies==0.7.0 From ba4d7f6435bbbceca830f137f452b42118651b1a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 27 Mar 2024 01:19:41 -0700 Subject: [PATCH 158/234] Update djangorestframework from 3.15.0 to 3.15.1 (#4941) --- {{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 258bf3c21..7ed8623b7 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -40,7 +40,7 @@ django-compressor==4.4 # https://github.com/django-compressor/django-compressor django-redis==5.4.0 # https://github.com/jazzband/django-redis {%- if cookiecutter.use_drf == 'y' %} # Django REST Framework -djangorestframework==3.15.0 # https://github.com/encode/django-rest-framework +djangorestframework==3.15.1 # https://github.com/encode/django-rest-framework django-cors-headers==4.3.1 # https://github.com/adamchainz/django-cors-headers # DRF-spectacular for api documentation drf-spectacular==0.27.1 # https://github.com/tfranzel/drf-spectacular From f07848448a85fc9890885066f3cdb778eb29f26b Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 27 Mar 2024 01:20:37 -0700 Subject: [PATCH 159/234] Update pygithub from 2.2.0 to 2.3.0 (#4942) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 77505f83e..4a27221aa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,7 +20,7 @@ pyyaml==6.0.1 # Scripting # ------------------------------------------------------------------------------ -PyGithub==2.2.0 +PyGithub==2.3.0 gitpython==3.1.42 jinja2==3.1.3 requests==2.31.0 From 4166119930520fe22b0562f49ae9942dffad46fd Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 27 Mar 2024 01:20:50 -0700 Subject: [PATCH 160/234] Update pre-commit to 3.7.0 (#4943) * Update pre-commit from 3.6.2 to 3.7.0 * Update pre-commit from 3.6.2 to 3.7.0 --- 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 4a27221aa..4183c7c6d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,7 @@ binaryornot==0.4.4 ruff==0.3.4 django-upgrade==1.16.0 djlint==1.34.1 -pre-commit==3.6.2 +pre-commit==3.7.0 # Testing # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 829ea4445..75a1d4c10 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -31,7 +31,7 @@ sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild ruff==0.3.4 # https://github.com/astral-sh/ruff coverage==7.4.4 # https://github.com/nedbat/coveragepy djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint -pre-commit==3.6.2 # https://github.com/pre-commit/pre-commit +pre-commit==3.7.0 # https://github.com/pre-commit/pre-commit # Django # ------------------------------------------------------------------------------ From a8ff250a9da8580e9791a60b52621ace74029207 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 28 Mar 2024 02:12:49 +0000 Subject: [PATCH 161/234] Release 2024.03.27 --- CHANGELOG.md | 13 +++++++++++++ setup.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a174475ee..81e5bcf9d 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.03.27 + + +### Updated + +- Update pre-commit to 3.7.0 ([#4943](https://github.com/cookiecutter/cookiecutter-django/pull/4943)) + +- Update djangorestframework to 3.15.1 ([#4941](https://github.com/cookiecutter/cookiecutter-django/pull/4941)) + +- Update ruff to 0.3.4 ([#4936](https://github.com/cookiecutter/cookiecutter-django/pull/4936)) + +- Auto-update pre-commit hooks ([#4937](https://github.com/cookiecutter/cookiecutter-django/pull/4937)) + ## 2024.03.26 diff --git a/setup.py b/setup.py index c9b67d80a..6f99d239b 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.03.26" +version = "2024.03.27" with open("README.md") as readme_file: long_description = readme_file.read() From 099d0f2391ddd8ea364dcd4af517b1a6e9f22cdc Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 28 Mar 2024 16:04:42 +0000 Subject: [PATCH 162/234] Update sentry-sdk from 1.43.0 to 1.44.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 e412bd0cc..204a809ed 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==1.43.0 # https://github.com/getsentry/sentry-python +sentry-sdk==1.44.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 bca7d02f0aea2b481f1de7e37b035e0289bf9624 Mon Sep 17 00:00:00 2001 From: Abe Hanoka Date: Fri, 29 Mar 2024 05:48:14 -0400 Subject: [PATCH 163/234] Add instruction for adding a django app (#4944) * feat(docs): add instruction for adding a django app Following the the steps outlined in: https://github.com/cookiecutter/cookiecutter-django/discussions/4339#discussioncomment-5922166 this PR adds a "Creating Your First Django App" section to the docs breifly expalins the file structure and outlines the steps to add a new app. * Update docs/developing-locally.rst Co-authored-by: Bruno Alla * Update docs/developing-locally.rst Co-authored-by: Bruno Alla --------- Co-authored-by: Bruno Alla --- docs/developing-locally.rst | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/docs/developing-locally.rst b/docs/developing-locally.rst index f7191d27d..16247d082 100644 --- a/docs/developing-locally.rst +++ b/docs/developing-locally.rst @@ -96,6 +96,61 @@ First things first. .. _direnv: https://direnv.net/ +Creating Your First Django App +------------------------------- + +After setting up your environment, you're ready to add your first app. This project uses the setup from "Two Scoops of Django" with a two-tier layout: + +- **Top Level Repository Root** has config files, documentation, `manage.py`, and more. +- **Second Level Django Project Root** is where your Django apps live. +- **Second Level Configuration Root** holds settings and URL configurations. + +The project layout looks something like this: :: + + / + ├── config/ + │ ├── settings/ + │ │ ├── __init__.py + │ │ ├── base.py + │ │ ├── local.py + │ │ └── production.py + │ ├── urls.py + │ └── wsgi.py + ├── / + │ ├── / + │ │ ├── migrations/ + │ │ ├── admin.py + │ │ ├── apps.py + │ │ ├── models.py + │ │ ├── tests.py + │ │ └── views.py + │ ├── __init__.py + │ └── ... + ├── requirements/ + │ ├── base.txt + │ ├── local.txt + │ └── production.txt + ├── manage.py + ├── README.md + └── ... + + +Following this structured approach, here's how to add a new app: + +#. **Create the app** using Django's ``startapp`` command, replacing ```` with your desired app name: :: + + $ python manage.py startapp + +#. **Move the app** to the Django Project Root, maintaining the project's two-tier structure: :: + + $ mv / + +#. **Edit the app's apps.py** change ``name = ''`` to ``name = '.'``. + +#. **Register the new app** by adding it to the ``LOCAL_APPS`` list in ``config/settings/base.py``, integrating it as an official component of your project. + + + Setup Email Backend ------------------- From b9e88f94a7af107a29188abbb9d34126cfb7362e Mon Sep 17 00:00:00 2001 From: GvS Date: Fri, 29 Mar 2024 12:06:05 +0000 Subject: [PATCH 164/234] Change pytest import mode to importlib --- {{cookiecutter.project_slug}}/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index ed27e2c9e..b62923747 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -1,7 +1,7 @@ # ==== pytest ==== [tool.pytest.ini_options] minversion = "6.0" -addopts = "--ds=config.settings.test --reuse-db" +addopts = "--ds=config.settings.test --reuse-db --import-mode=importlib" python_files = [ "tests.py", "test_*.py", From 35f21ba6973b5b3e7151657af5f1b2ce432f3b9c Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 30 Mar 2024 02:08:54 +0000 Subject: [PATCH 165/234] Release 2024.03.29 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81e5bcf9d..dd9f9fcf7 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.03.29 + + +### Documentation + +- Add instruction for adding a django app ([#4944](https://github.com/cookiecutter/cookiecutter-django/pull/4944)) + ## 2024.03.27 diff --git a/setup.py b/setup.py index 6f99d239b..981a5e962 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.03.27" +version = "2024.03.29" with open("README.md") as readme_file: long_description = readme_file.read() From 719fa5d57b0217d79236b94d5aad1d07d7ecf106 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 31 Mar 2024 10:47:17 +0100 Subject: [PATCH 166/234] Update gitpython from 3.1.42 to 3.1.43 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4183c7c6d..7b6f54df6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,6 +21,6 @@ pyyaml==6.0.1 # Scripting # ------------------------------------------------------------------------------ PyGithub==2.3.0 -gitpython==3.1.42 +gitpython==3.1.43 jinja2==3.1.3 requests==2.31.0 From 5af055bccb151df9d867eef2cb08c185498cbef4 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 1 Apr 2024 17:25:02 +0300 Subject: [PATCH 167/234] Update pillow from 10.2.0 to 10.3.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 7ed8623b7..3d634e82e 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,5 +1,5 @@ python-slugify==8.0.4 # https://github.com/un33k/python-slugify -Pillow==10.2.0 # https://github.com/python-pillow/Pillow +Pillow==10.3.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} {%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} rcssmin==1.1.0 --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin From 349679ef330e948f53dfeb2eeb2be8eadd4f0dde Mon Sep 17 00:00:00 2001 From: Patrick Zhang Date: Tue, 2 Apr 2024 02:11:25 +0800 Subject: [PATCH 168/234] Use main over master for branch name in deployment-on-heroku instruction --- docs/deployment-on-heroku.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deployment-on-heroku.rst b/docs/deployment-on-heroku.rst index 71c6e11b2..fdd953e09 100644 --- a/docs/deployment-on-heroku.rst +++ b/docs/deployment-on-heroku.rst @@ -46,7 +46,7 @@ Run these commands to deploy the project to Heroku: # Assign with AWS_STORAGE_BUCKET_NAME heroku config:set DJANGO_AWS_STORAGE_BUCKET_NAME= - git push heroku master + git push heroku main heroku run python manage.py createsuperuser From a3f3268c95ab88b449e787f0e26efdd951e18122 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 1 Apr 2024 21:42:18 +0300 Subject: [PATCH 169/234] Update ruff from 0.3.4 to 0.3.5 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4183c7c6d..1df9506a9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -ruff==0.3.4 +ruff==0.3.5 django-upgrade==1.16.0 djlint==1.34.1 pre-commit==3.7.0 From a43cbf070911c70b3096c749e860b7bbccf68844 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 1 Apr 2024 21:42:18 +0300 Subject: [PATCH 170/234] Update ruff from 0.3.4 to 0.3.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 75a1d4c10..4a0177574 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -28,7 +28,7 @@ sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ -ruff==0.3.4 # https://github.com/astral-sh/ruff +ruff==0.3.5 # https://github.com/astral-sh/ruff coverage==7.4.4 # 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 79b2828f7b6169aa2c3d826160b188ab5e150edd Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 1 Apr 2024 22:40:09 +0300 Subject: [PATCH 171/234] Update django-model-utils from 4.4.0 to 4.5.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 7ed8623b7..44e73a2f7 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.11 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.11.2 # https://github.com/joke2k/django-environ -django-model-utils==4.4.0 # https://github.com/jazzband/django-model-utils +django-model-utils==4.5.0 # https://github.com/jazzband/django-model-utils django-allauth[mfa]==0.61.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 308139717dbec185478d4b2dbffbb315185e29f7 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 1 Apr 2024 22:40:12 +0300 Subject: [PATCH 172/234] Update drf-spectacular from 0.27.1 to 0.27.2 --- {{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 7ed8623b7..0cf154c6a 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -43,7 +43,7 @@ django-redis==5.4.0 # https://github.com/jazzband/django-redis djangorestframework==3.15.1 # https://github.com/encode/django-rest-framework django-cors-headers==4.3.1 # https://github.com/adamchainz/django-cors-headers # DRF-spectacular for api documentation -drf-spectacular==0.27.1 # https://github.com/tfranzel/drf-spectacular +drf-spectacular==0.27.2 # https://github.com/tfranzel/drf-spectacular {%- endif %} {%- if cookiecutter.frontend_pipeline == 'Webpack' %} django-webpack-loader==3.0.1 # https://github.com/django-webpack/django-webpack-loader From 1c9c91b15ee50541a4f1550d7d2b0a26f736a2df Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 1 Apr 2024 22:40:40 +0300 Subject: [PATCH 173/234] Update werkzeug from 3.0.1 to 3.0.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 75a1d4c10..5fe3bad32 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.1 # https://github.com/pallets/werkzeug +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 From 88998244605841af805dba363abdcb15cea18318 Mon Sep 17 00:00:00 2001 From: browniebroke <861044+browniebroke@users.noreply.github.com> Date: Tue, 2 Apr 2024 02:24:13 +0000 Subject: [PATCH 174/234] Auto-update pre-commit hooks --- {{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 bed85ad77..ece70ffe7 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.3.4 + rev: v0.3.5 hooks: # Linter - id: ruff From 525ebf2b452ec72ecb26738288af4c888b82885c Mon Sep 17 00:00:00 2001 From: Simon Liska <40433119+simonliska@users.noreply.github.com> Date: Tue, 2 Apr 2024 17:22:33 +0200 Subject: [PATCH 175/234] change obsolete docker image "docker/compose:1.29.2" to "docker:25.0" --- {{cookiecutter.project_slug}}/.drone.yml | 2 +- {{cookiecutter.project_slug}}/.gitlab-ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.drone.yml b/{{cookiecutter.project_slug}}/.drone.yml index 2753fa4e0..829ead2ca 100644 --- a/{{cookiecutter.project_slug}}/.drone.yml +++ b/{{cookiecutter.project_slug}}/.drone.yml @@ -27,7 +27,7 @@ steps: - name: test pull: if-not-exists {%- if cookiecutter.use_docker == 'y' %} - image: docker/compose:1.29.2 + image: docker:25.0 environment: DATABASE_URL: pgsql://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres/$POSTGRES_DB commands: diff --git a/{{cookiecutter.project_slug}}/.gitlab-ci.yml b/{{cookiecutter.project_slug}}/.gitlab-ci.yml index df823db1f..75c03e876 100644 --- a/{{cookiecutter.project_slug}}/.gitlab-ci.yml +++ b/{{cookiecutter.project_slug}}/.gitlab-ci.yml @@ -27,7 +27,7 @@ precommit: pytest: stage: test {%- if cookiecutter.use_docker == 'y' %} - image: docker/compose:1.29.2 + image: docker:25.0 tags: - docker services: From d430e2f3fc34b35886d3996b0340baab6c4bf459 Mon Sep 17 00:00:00 2001 From: foarsitter Date: Tue, 2 Apr 2024 16:53:50 +0000 Subject: [PATCH 176/234] 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 b47a56246..2ab66f484 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1538,5 +1538,10 @@ "name": "Simeon Emanuilov", "github_login": "s-emanuilov", "twitter_username": "s_emanuilov" + }, + { + "name": "Patrick Zhang", + "github_login": "PatDuJour", + "twitter_username": "" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index c14c0ea3b..b2c6b68b0 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1664,6 +1664,13 @@ Listed in alphabetical order. + + Patrick Zhang + + PatDuJour + + + Paul Wulff From ab691894825037638ba5275e32ac49b865e042d1 Mon Sep 17 00:00:00 2001 From: foarsitter Date: Tue, 2 Apr 2024 16:59:48 +0000 Subject: [PATCH 177/234] 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 2ab66f484..7cac13aee 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1543,5 +1543,10 @@ "name": "Patrick Zhang", "github_login": "PatDuJour", "twitter_username": "" + }, + { + "name": "GvS", + "github_login": "GvS666", + "twitter_username": "" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index b2c6b68b0..1d0cd69bf 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -915,6 +915,13 @@ Listed in alphabetical order. + + GvS + + GvS666 + + + Hamish Durkin From 27734891aba105f3a3f7d5c670cf786723bda22e Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 3 Apr 2024 02:11:47 +0000 Subject: [PATCH 178/234] Release 2024.04.02 --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ setup.py | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd9f9fcf7..b337c3d6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,35 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.04.02 + + +### Changed + +- Change pytest import mode to importlib ([#4950](https://github.com/cookiecutter/cookiecutter-django/pull/4950)) + +- Use main over master for branch name in deployment-on-heroku instruction ([#4954](https://github.com/cookiecutter/cookiecutter-django/pull/4954)) + +- change obsolete docker image "docker/compose:1.29.2" to "docker:25.0" ([#4961](https://github.com/cookiecutter/cookiecutter-django/pull/4961)) + +### Updated + +- Update sentry-sdk to 1.44.0 ([#4948](https://github.com/cookiecutter/cookiecutter-django/pull/4948)) + +- Update ruff to 0.3.5 ([#4955](https://github.com/cookiecutter/cookiecutter-django/pull/4955)) + +- Update gitpython to 3.1.43 ([#4951](https://github.com/cookiecutter/cookiecutter-django/pull/4951)) + +- Update pillow to 10.3.0 ([#4953](https://github.com/cookiecutter/cookiecutter-django/pull/4953)) + +- Update django-model-utils to 4.5.0 ([#4956](https://github.com/cookiecutter/cookiecutter-django/pull/4956)) + +- Update drf-spectacular to 0.27.2 ([#4957](https://github.com/cookiecutter/cookiecutter-django/pull/4957)) + +- Update werkzeug to 3.0.2 ([#4958](https://github.com/cookiecutter/cookiecutter-django/pull/4958)) + +- Auto-update pre-commit hooks ([#4959](https://github.com/cookiecutter/cookiecutter-django/pull/4959)) + ## 2024.03.29 diff --git a/setup.py b/setup.py index 981a5e962..e9f21bbf7 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.03.29" +version = "2024.04.02" with open("README.md") as readme_file: long_description = readme_file.read() From 39af43520183c029d0e61698c81b78cc35476f5a Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 3 Apr 2024 03:28:07 -0700 Subject: [PATCH 179/234] Update sentry-sdk from 1.44.0 to 1.44.1 (#4963) --- {{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 204a809ed..f16975053 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==1.44.0 # https://github.com/getsentry/sentry-python +sentry-sdk==1.44.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 559fae8a70b2feaf244e0eb0e1699a8201e94411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20P=C4=83cioianu?= Date: Wed, 3 Apr 2024 16:49:12 +0300 Subject: [PATCH 180/234] Update ci.yml (#4964) --- {{cookiecutter.project_slug}}/.github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index 4e24af5a9..8bd0e3307 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.12' @@ -34,7 +34,7 @@ jobs: # Consider using pre-commit.ci for open source project {%- endif %} - name: Run pre-commit - uses: pre-commit/action@v3.0.0 + uses: pre-commit/action@v3.0.1 # With no caching at all the entire ci process takes 3m to complete! pytest: From 1661e553759f615494c63deb676d780bfff10354 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 3 Apr 2024 13:49:59 +0000 Subject: [PATCH 181/234] 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 7cac13aee..eebde5e91 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1548,5 +1548,10 @@ "name": "GvS", "github_login": "GvS666", "twitter_username": "" + }, + { + "name": "David Păcioianu", + "github_login": "DavidPacioianu", + "twitter_username": "" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 1d0cd69bf..b30e27e7b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -656,6 +656,13 @@ Listed in alphabetical order. DavidDiazPinto + + David Păcioianu + + DavidPacioianu + + + Davit Tovmasyan From 831ce14ca320125b4176ed99b82956570789abf5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 4 Apr 2024 02:11:59 +0000 Subject: [PATCH 182/234] Release 2024.04.03 --- CHANGELOG.md | 11 +++++++++++ setup.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b337c3d6b..8f7624ab3 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.04.03 + + +### Changed + +- Update GH actions to resolve deprecation warnings ([#4964](https://github.com/cookiecutter/cookiecutter-django/pull/4964)) + +### Updated + +- Update sentry-sdk to 1.44.1 ([#4963](https://github.com/cookiecutter/cookiecutter-django/pull/4963)) + ## 2024.04.02 diff --git a/setup.py b/setup.py index e9f21bbf7..a9369e7ab 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.02" +version = "2024.04.03" with open("README.md") as readme_file: long_description = readme_file.read() From aa0e49ae4ba1a1f626ec231f8468ae98d5c1e50a Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 4 Apr 2024 16:41:29 +0300 Subject: [PATCH 183/234] Update django-webpack-loader from 3.0.1 to 3.1.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 588a64c95..8f93227f7 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -46,5 +46,5 @@ django-cors-headers==4.3.1 # https://github.com/adamchainz/django-cors-headers drf-spectacular==0.27.2 # https://github.com/tfranzel/drf-spectacular {%- endif %} {%- if cookiecutter.frontend_pipeline == 'Webpack' %} -django-webpack-loader==3.0.1 # https://github.com/django-webpack/django-webpack-loader +django-webpack-loader==3.1.0 # https://github.com/django-webpack/django-webpack-loader {%- endif %} From 83ceb39b50355d92f0f164b30f2c6fbca5ed36f2 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 6 Apr 2024 02:10:14 +0000 Subject: [PATCH 184/234] Release 2024.04.05 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f7624ab3..e8fb2c4c6 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.04.05 + + +### Updated + +- Update django-webpack-loader to 3.1.0 ([#4965](https://github.com/cookiecutter/cookiecutter-django/pull/4965)) + ## 2024.04.03 diff --git a/setup.py b/setup.py index a9369e7ab..8dce27d0d 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.03" +version = "2024.04.05" with open("README.md") as readme_file: long_description = readme_file.read() From 8060df4c518fd4742db05419ddd720314df85444 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Sat, 6 Apr 2024 14:01:30 +0530 Subject: [PATCH 185/234] Fix syntax error in GitHub CI workflow (#4972) --- {{cookiecutter.project_slug}}/.github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index 8bd0e3307..4e6ec1cd2 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -70,7 +70,9 @@ jobs: - name: Build the Stack run: docker compose -f local.yml build django - run: docker compose -f local.yml build docs + + - name: Build the docs + run: docker compose -f docs.yml build docs - name: Run DB Migrations run: docker compose -f local.yml run --rm django python manage.py migrate From b99ad3986211b0366e269a970a5f7eaa40da24e2 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 7 Apr 2024 02:13:12 +0000 Subject: [PATCH 186/234] Release 2024.04.06 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8fb2c4c6..bc97ee417 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.04.06 + + +### Fixed + +- Fix syntax error in GitHub CI workflow ([#4972](https://github.com/cookiecutter/cookiecutter-django/pull/4972)) + ## 2024.04.05 diff --git a/setup.py b/setup.py index 8dce27d0d..85f58e163 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.05" +version = "2024.04.06" with open("README.md") as readme_file: long_description = readme_file.read() From eae5c9c1cdd11822cf6cbadc7974eef95eec5832 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 7 Apr 2024 09:11:22 +0200 Subject: [PATCH 187/234] Auto-update pre-commit hooks (#4974) Co-authored-by: browniebroke <861044+browniebroke@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- {{cookiecutter.project_slug}}/.pre-commit-config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9d0fd0f25..61924dfad 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ default_language_version: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index ece70ffe7..b1725ebc4 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -6,7 +6,7 @@ default_language_version: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer From 681c13e0fa2a51b65c7026f0d431d34327cf8578 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 8 Apr 2024 02:12:34 +0000 Subject: [PATCH 188/234] Release 2024.04.07 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc97ee417..8a542d9f1 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.04.07 + + +### Updated + +- Auto-update pre-commit hooks ([#4974](https://github.com/cookiecutter/cookiecutter-django/pull/4974)) + ## 2024.04.06 diff --git a/setup.py b/setup.py index 85f58e163..de4fd53b4 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.06" +version = "2024.04.07" with open("README.md") as readme_file: long_description = readme_file.read() From 5916cf0d3075f79947c4a6e2cd4a2fef1170af63 Mon Sep 17 00:00:00 2001 From: farwill Date: Tue, 9 Apr 2024 21:53:08 +0800 Subject: [PATCH 189/234] Fix start command for docs (#4978) --- docs/document.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/document.rst b/docs/document.rst index 26f5d56a1..f93f2b60e 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 local.yml up docs + $ docker compose -f 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. From 0e63336ddb4a0ac070ecad81ce86c010c867641b Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 9 Apr 2024 13:53:53 +0000 Subject: [PATCH 190/234] 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 eebde5e91..e7bee5dee 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1553,5 +1553,10 @@ "name": "David Păcioianu", "github_login": "DavidPacioianu", "twitter_username": "" + }, + { + "name": "farwill", + "github_login": "farwill", + "twitter_username": "" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index b30e27e7b..a8a09b098 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -817,6 +817,13 @@ Listed in alphabetical order. fabaff + + farwill + + farwill + + + Fateme Fouladkar From f6081a32f750edaf4220b57f5d935b06006f9b26 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 10 Apr 2024 02:11:37 +0000 Subject: [PATCH 191/234] Release 2024.04.09 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a542d9f1..f38c91025 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.04.09 + + +### Documentation + +- Fix start command for docs ([#4978](https://github.com/cookiecutter/cookiecutter-django/pull/4978)) + ## 2024.04.07 diff --git a/setup.py b/setup.py index de4fd53b4..3cec71606 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.07" +version = "2024.04.09" with open("README.md") as readme_file: long_description = readme_file.read() From d8ade3be0d4084343194455ec960d83ad5b4da33 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 09:14:10 +0100 Subject: [PATCH 192/234] Bump python from 3.12.2 to 3.12.3 in production (#4980) Bumps python from 3.12.2-slim-bookworm to 3.12.3-slim-bookworm. --- updated-dependencies: - dependency-name: python dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../compose/production/django/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 19b2cb0aa..671eb4635 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -25,7 +25,7 @@ RUN npm run build {%- endif %} # define an alias for the specific python version used in this file. -FROM docker.io/python:3.12.2-slim-bookworm as python +FROM docker.io/python:3.12.3-slim-bookworm as python # Python build stage FROM python as python-build-stage From df0d91c87303b0922fb884916d0e104d31f4f03b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 09:14:26 +0100 Subject: [PATCH 193/234] Bump python from 3.12.2 to 3.12.3 in local (#4981) Bumps python from 3.12.2-slim-bookworm to 3.12.3-slim-bookworm. --- updated-dependencies: - dependency-name: python dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- {{cookiecutter.project_slug}}/compose/local/django/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index 0897ab95d..88ccb7491 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -1,5 +1,5 @@ # define an alias for the specific python version used in this file. -FROM docker.io/python:3.12.2-slim-bookworm as python +FROM docker.io/python:3.12.3-slim-bookworm as python # Python build stage FROM python as python-build-stage From 8492ebe631febb48e2cbbc5aadb54174a0b59ed3 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 10 Apr 2024 09:16:14 +0100 Subject: [PATCH 194/234] Update Heroku runtime from Python 3.12.2 to Python 3.12.3 --- {{cookiecutter.project_slug}}/runtime.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/runtime.txt b/{{cookiecutter.project_slug}}/runtime.txt index 6e797d468..4ddc7cd66 100644 --- a/{{cookiecutter.project_slug}}/runtime.txt +++ b/{{cookiecutter.project_slug}}/runtime.txt @@ -1 +1 @@ -python-3.12.2 +python-3.12.3 From 8a2eb3142f7cd3befef099c94a096aa57e8804ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 10:15:26 +0100 Subject: [PATCH 195/234] Bump python in /{{cookiecutter.project_slug}}/compose/local/docs (#4979) Bumps python from 3.12.2-slim-bookworm to 3.12.3-slim-bookworm. --- updated-dependencies: - dependency-name: python dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bruno Alla --- {{cookiecutter.project_slug}}/compose/local/docs/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile index 9251effba..35565042d 100644 --- a/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile @@ -1,5 +1,5 @@ # define an alias for the specific python version used in this file. -FROM docker.io/python:3.12.2-slim-bookworm as python +FROM docker.io/python:3.12.3-slim-bookworm as python # Python build stage From 7d032d730383ed8af6fef130bde2dedc06f9332a Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 11 Apr 2024 02:12:36 +0000 Subject: [PATCH 196/234] Release 2024.04.10 --- CHANGELOG.md | 11 +++++++++++ setup.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f38c91025..781dfc848 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.04.10 + + +### Updated + +- Bump python from 3.12.2 to 3.12.3 in docs ([#4979](https://github.com/cookiecutter/cookiecutter-django/pull/4979)) + +- Bump python from 3.12.2 to 3.12.3 in local ([#4981](https://github.com/cookiecutter/cookiecutter-django/pull/4981)) + +- Bump python from 3.12.2 to 3.12.3 in production ([#4980](https://github.com/cookiecutter/cookiecutter-django/pull/4980)) + ## 2024.04.09 diff --git a/setup.py b/setup.py index 3cec71606..9cd064a0f 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.09" +version = "2024.04.10" with open("README.md") as readme_file: long_description = readme_file.read() From 94269f8c7f8e058698663cf2d5ae6d0915b90a38 Mon Sep 17 00:00:00 2001 From: JAEGYUN JUNG Date: Tue, 16 Apr 2024 21:18:05 +0900 Subject: [PATCH 197/234] Add a prefix setting so that swagger tags are generated in a readable way (#4975) * feat: Add a prefix setting so that swagger tags are generated in a readable way * feat: Change `auth-token` URLs --- {{cookiecutter.project_slug}}/config/settings/base.py | 1 + {{cookiecutter.project_slug}}/config/urls.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index b7eb7e80f..f1039b748 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -372,6 +372,7 @@ SPECTACULAR_SETTINGS = { "DESCRIPTION": "Documentation of API endpoints of {{ cookiecutter.project_name }}", "VERSION": "1.0.0", "SERVE_PERMISSIONS": ["rest_framework.permissions.IsAdminUser"], + "SCHEMA_PATH_PREFIX": "/api/", } {%- endif %} {%- if cookiecutter.frontend_pipeline == 'Webpack' %} diff --git a/{{cookiecutter.project_slug}}/config/urls.py b/{{cookiecutter.project_slug}}/config/urls.py index 5d9301b67..aca4352e6 100644 --- a/{{cookiecutter.project_slug}}/config/urls.py +++ b/{{cookiecutter.project_slug}}/config/urls.py @@ -43,7 +43,7 @@ urlpatterns += [ # API base url path("api/", include("config.api_router")), # DRF auth token - path("auth-token/", obtain_auth_token), + path("api/auth-token/", obtain_auth_token), path("api/schema/", SpectacularAPIView.as_view(), name="api-schema"), path( "api/docs/", From b96dac09a9bd83fe5d0cc926422cde1db1f28b3a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 13:54:47 +0100 Subject: [PATCH 198/234] Auto-update pre-commit hooks (#4988) Co-authored-by: browniebroke <861044+browniebroke@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- {{cookiecutter.project_slug}}/.pre-commit-config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 61924dfad..97cad833b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: exclude: hooks/ - repo: https://github.com/psf/black - rev: 24.3.0 + rev: 24.4.0 hooks: - id: black diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index b1725ebc4..df0e358c7 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.3.5 + rev: v0.3.7 hooks: # Linter - id: ruff From 5395aeff5294d1ebe9c90051601db808fb7c03b7 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 16 Apr 2024 05:55:03 -0700 Subject: [PATCH 199/234] Update ruff to 0.3.7 (#4989) * Update ruff from 0.3.5 to 0.3.7 * Update ruff from 0.3.5 to 0.3.7 --- 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 0a43ec95f..5da67bc34 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -ruff==0.3.5 +ruff==0.3.7 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 d290b0213..3887294f2 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -28,7 +28,7 @@ sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ -ruff==0.3.5 # https://github.com/astral-sh/ruff +ruff==0.3.7 # https://github.com/astral-sh/ruff coverage==7.4.4 # 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 8d2b6a265bff05e3b28bc39ecf33e79b39d45736 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 16 Apr 2024 05:55:57 -0700 Subject: [PATCH 200/234] Update sentry-sdk from 1.44.1 to 1.45.0 (#4982) --- {{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 f16975053..a88351ffe 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==1.44.1 # https://github.com/getsentry/sentry-python +sentry-sdk==1.45.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 c6b972d712791665272aa9c198a68ddb07214848 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 16 Apr 2024 05:56:18 -0700 Subject: [PATCH 201/234] Update sphinx-autobuild from 2024.2.4 to 2024.4.13 (#4991) --- {{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 3887294f2..f0918bf86 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -24,7 +24,7 @@ djangorestframework-stubs[compatible-mypy]==3.14.5 # https://github.com/typeddj # Documentation # ------------------------------------------------------------------------------ sphinx==7.2.6 # https://github.com/sphinx-doc/sphinx -sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild +sphinx-autobuild==2024.4.13 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ From 79ff7ca0bb42acd0382627a4462d7ba4433941e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 13:56:46 +0100 Subject: [PATCH 202/234] Bump stefanzweifel/git-auto-commit-action from 5.0.0 to 5.0.1 (#4994) Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 5.0.0 to 5.0.1. - [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases) - [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v5.0.0...v5.0.1) --- updated-dependencies: - dependency-name: stefanzweifel/git-auto-commit-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/update-contributors.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-contributors.yml b/.github/workflows/update-contributors.yml index e814039db..c77bc5e8f 100644 --- a/.github/workflows/update-contributors.yml +++ b/.github/workflows/update-contributors.yml @@ -33,7 +33,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v5.0.0 + uses: stefanzweifel/git-auto-commit-action@v5.0.1 with: commit_message: Update Contributors file_pattern: CONTRIBUTORS.md .github/contributors.json From db607665265de1ab0cb8f2ed37386f9564feec23 Mon Sep 17 00:00:00 2001 From: Matthew Foster Walsh <15671892+mfosterw@users.noreply.github.com> Date: Tue, 16 Apr 2024 14:21:45 -0400 Subject: [PATCH 203/234] Update docs for `test_bare.sh` (#4996) --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 753e827aa..8d2025e37 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,13 +66,13 @@ $ source venv/bin/activate These tests are slower and can be run with or without Docker: -- Without Docker: `scripts/test_bare.sh` (for bare metal) -- With Docker: `scripts/test_docker.sh` +- Without Docker: `tests/test_bare.sh` (for bare metal) +- With Docker: `tests/test_docker.sh` All arguments to these scripts will be passed to the `cookiecutter` CLI, letting you set options, for example: ```bash -$ scripts/test_bare.sh use_celery=y +$ tests/test_bare.sh use_celery=y ``` ## Submitting a pull request From f79c89d928964e0c21ada42a8de10a2e25c6f540 Mon Sep 17 00:00:00 2001 From: quroom <39736691+quroom@users.noreply.github.com> Date: Wed, 17 Apr 2024 03:23:05 +0900 Subject: [PATCH 204/234] Add options to reload django when file changes in windows docker (#4971) * Add options to reload django when file changes in windows docker * Fix Reloader interval as default and make code with indent to be only in docker --- {{cookiecutter.project_slug}}/config/settings/local.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py index f1edb514b..ab526f968 100644 --- a/{{cookiecutter.project_slug}}/config/settings/local.py +++ b/{{cookiecutter.project_slug}}/config/settings/local.py @@ -83,6 +83,15 @@ if env("USE_DOCKER") == "yes": # The node container isn't started (yet?) pass {%- endif %} + {%- if cookiecutter.windows == 'y' %} + # RunServerPlus + # ------------------------------------------------------------------------------ + # This is a custom setting for RunServerPlus to fix reloader issue in Windows docker environment + # Werkzeug reloader type [auto, watchdog, or stat] + RUNSERVERPLUS_POLLER_RELOADER_TYPE = 'stat' + # If you have CPU and IO load issues, you can increase this poller interval e.g) 5 + RUNSERVERPLUS_POLLER_RELOADER_INTERVAL = 1 + {%- endif %} {%- endif %} # django-extensions From 173af52ebb8b7b3fa9ab4f1dc8e2d80fe4367672 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 16 Apr 2024 18:23:54 +0000 Subject: [PATCH 205/234] 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 e7bee5dee..40a7d26d6 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1558,5 +1558,10 @@ "name": "farwill", "github_login": "farwill", "twitter_username": "" + }, + { + "name": "quroom", + "github_login": "quroom", + "twitter_username": "" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index a8a09b098..bf4896dc8 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1755,6 +1755,13 @@ Listed in alphabetical order. + + quroom + + quroom + + + Raony Guimarães Corrêa From 9bd0eff3a729b90ab29a1defbd0627677a6f296f Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 16 Apr 2024 19:27:00 +0100 Subject: [PATCH 206/234] Update Discord invite link Fix #4990 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 995303b42..9412cdaa3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black) [![Updates](https://pyup.io/repos/github/cookiecutter/cookiecutter-django/shield.svg)](https://pyup.io/repos/github/cookiecutter/cookiecutter-django/) -[![Join our Discord](https://img.shields.io/badge/Discord-cookiecutter-5865F2?style=flat&logo=discord&logoColor=white)](https://discord.gg/uFXweDQc5a) +[![Join our Discord](https://img.shields.io/badge/Discord-cookiecutter-5865F2?style=flat&logo=discord&logoColor=white)]([https://discord.gg/uFXweDQc5a](https://discord.gg/rAWFUP47d2)) [![Code Helpers Badge](https://www.codetriage.com/cookiecutter/cookiecutter-django/badges/users.svg)](https://www.codetriage.com/cookiecutter/cookiecutter-django) Powered by [Cookiecutter](https://github.com/cookiecutter/cookiecutter), Cookiecutter Django is a framework for jumpstarting From 27b8450bc0f81d312e486ee03bc6d5d8d6a2811b Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 16 Apr 2024 19:28:17 +0100 Subject: [PATCH 207/234] Fix Discord link formatting in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9412cdaa3..c38eec277 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black) [![Updates](https://pyup.io/repos/github/cookiecutter/cookiecutter-django/shield.svg)](https://pyup.io/repos/github/cookiecutter/cookiecutter-django/) -[![Join our Discord](https://img.shields.io/badge/Discord-cookiecutter-5865F2?style=flat&logo=discord&logoColor=white)]([https://discord.gg/uFXweDQc5a](https://discord.gg/rAWFUP47d2)) +[![Join our Discord](https://img.shields.io/badge/Discord-cookiecutter-5865F2?style=flat&logo=discord&logoColor=white)](https://discord.gg/rAWFUP47d2) [![Code Helpers Badge](https://www.codetriage.com/cookiecutter/cookiecutter-django/badges/users.svg)](https://www.codetriage.com/cookiecutter/cookiecutter-django) Powered by [Cookiecutter](https://github.com/cookiecutter/cookiecutter), Cookiecutter Django is a framework for jumpstarting From ea68dd5c5de37fe5d3d01d4949148d6f5b0bba7f Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 16 Apr 2024 14:42:13 -0700 Subject: [PATCH 208/234] Update sphinx-autobuild from 2024.4.13 to 2024.4.16 (#4999) --- {{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 f0918bf86..7361d5df7 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -24,7 +24,7 @@ djangorestframework-stubs[compatible-mypy]==3.14.5 # https://github.com/typeddj # Documentation # ------------------------------------------------------------------------------ sphinx==7.2.6 # https://github.com/sphinx-doc/sphinx -sphinx-autobuild==2024.4.13 # https://github.com/GaretJax/sphinx-autobuild +sphinx-autobuild==2024.4.16 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ From 7fde9bf188a50129a7a84bc0290c67c04ee7cdce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 22:47:00 +0100 Subject: [PATCH 209/234] Bump traefik from 2.11.0 to 2.11.2 (#4993) --- updated-dependencies: - dependency-name: traefik dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../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 ea918e911..d54bf27ca 100644 --- a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/traefik:2.11.0 +FROM docker.io/traefik:2.11.2 RUN mkdir -p /etc/traefik/acme \ && touch /etc/traefik/acme/acme.json \ && chmod 600 /etc/traefik/acme/acme.json From cf7dfed348bb2a6bd3504776036f865199456ad7 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 17 Apr 2024 02:12:39 +0000 Subject: [PATCH 210/234] Release 2024.04.16 --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ setup.py | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 781dfc848..d08d3c652 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,35 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.04.16 + + +### Changed + +- Add a prefix setting so that swagger tags are generated in a readable way ([#4975](https://github.com/cookiecutter/cookiecutter-django/pull/4975)) + +### Fixed + +- Fix `runserver_plus` hot-reload when under Windows + Docker ([#4971](https://github.com/cookiecutter/cookiecutter-django/pull/4971)) + +### Documentation + +- Update docs for `test_bare.sh` ([#4996](https://github.com/cookiecutter/cookiecutter-django/pull/4996)) + +### Updated + +- Bump traefik from 2.11.0 to 2.11.2 ([#4993](https://github.com/cookiecutter/cookiecutter-django/pull/4993)) + +- Update sphinx-autobuild to 2024.4.16 ([#4999](https://github.com/cookiecutter/cookiecutter-django/pull/4999)) + +- Update sphinx-autobuild to 2024.4.13 ([#4991](https://github.com/cookiecutter/cookiecutter-django/pull/4991)) + +- Update sentry-sdk to 1.45.0 ([#4982](https://github.com/cookiecutter/cookiecutter-django/pull/4982)) + +- Update ruff to 0.3.7 ([#4989](https://github.com/cookiecutter/cookiecutter-django/pull/4989)) + +- Auto-update pre-commit hooks ([#4988](https://github.com/cookiecutter/cookiecutter-django/pull/4988)) + ## 2024.04.10 diff --git a/setup.py b/setup.py index 9cd064a0f..220f93972 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.10" +version = "2024.04.16" with open("README.md") as readme_file: long_description = readme_file.read() From 861ad0d1fc411a333ac91d17a7d1fde8f62b49df Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 17 Apr 2024 01:18:40 -0700 Subject: [PATCH 211/234] Update sphinx to 7.3.3 (#5000) * Update sphinx from 7.2.6 to 7.3.3 * Update sphinx from 7.2.6 to 7.3.3 --- docs/requirements.txt | 2 +- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index d002affa7..c3bd45e50 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,3 @@ -sphinx==7.2.6 +sphinx==7.3.3 sphinx-rtd-theme==2.0.0 myst-parser==2.0.0 diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 7361d5df7..18264dbda 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -23,7 +23,7 @@ djangorestframework-stubs[compatible-mypy]==3.14.5 # https://github.com/typeddj # Documentation # ------------------------------------------------------------------------------ -sphinx==7.2.6 # https://github.com/sphinx-doc/sphinx +sphinx==7.3.3 # https://github.com/sphinx-doc/sphinx sphinx-autobuild==2024.4.16 # https://github.com/GaretJax/sphinx-autobuild # Code quality From 5f78a8f190da56910bebe82c420649816c439f78 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 17 Apr 2024 01:19:19 -0700 Subject: [PATCH 212/234] Update gunicorn to 22.0.0 (#5001) --- {{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 a88351ffe..29e23563e 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -2,7 +2,7 @@ -r base.txt -gunicorn==21.2.0 # https://github.com/benoitc/gunicorn +gunicorn==22.0.0 # https://github.com/benoitc/gunicorn psycopg[c]==3.1.18 # https://github.com/psycopg/psycopg {%- if cookiecutter.use_whitenoise == 'n' %} Collectfast==2.2.0 # https://github.com/antonagestam/collectfast From 352e5dae21deab3409adb3c4c133fe26381d0286 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 17 Apr 2024 01:32:31 -0700 Subject: [PATCH 213/234] Update sphinx to 7.3.5 (#5003) * Update sphinx from 7.3.3 to 7.3.5 * Update sphinx from 7.3.3 to 7.3.5 --- docs/requirements.txt | 2 +- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index c3bd45e50..a292267f6 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,3 @@ -sphinx==7.3.3 +sphinx==7.3.5 sphinx-rtd-theme==2.0.0 myst-parser==2.0.0 diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 18264dbda..cc449ffc4 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -23,7 +23,7 @@ djangorestframework-stubs[compatible-mypy]==3.14.5 # https://github.com/typeddj # Documentation # ------------------------------------------------------------------------------ -sphinx==7.3.3 # https://github.com/sphinx-doc/sphinx +sphinx==7.3.5 # https://github.com/sphinx-doc/sphinx sphinx-autobuild==2024.4.16 # https://github.com/GaretJax/sphinx-autobuild # Code quality From 2e9decda8d38abd7aa669897282902116522d33c Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 18 Apr 2024 02:11:51 +0000 Subject: [PATCH 214/234] Release 2024.04.17 --- CHANGELOG.md | 11 +++++++++++ setup.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d08d3c652..422722602 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.04.17 + + +### Updated + +- Update sphinx to 7.3.5 ([#5003](https://github.com/cookiecutter/cookiecutter-django/pull/5003)) + +- Update gunicorn to 22.0.0 ([#5001](https://github.com/cookiecutter/cookiecutter-django/pull/5001)) + +- Update sphinx to 7.3.3 ([#5000](https://github.com/cookiecutter/cookiecutter-django/pull/5000)) + ## 2024.04.16 diff --git a/setup.py b/setup.py index 220f93972..30f85acd6 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.16" +version = "2024.04.17" with open("README.md") as readme_file: long_description = readme_file.read() From e8e89f66e9b1d8e48c4e6bf95b88103d635f4c81 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 18 Apr 2024 00:54:24 -0700 Subject: [PATCH 215/234] Update sphinx to 7.3.6 (#5004) * Update sphinx from 7.3.5 to 7.3.6 * Update sphinx from 7.3.5 to 7.3.6 --- docs/requirements.txt | 2 +- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index a292267f6..efad5ede7 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,3 @@ -sphinx==7.3.5 +sphinx==7.3.6 sphinx-rtd-theme==2.0.0 myst-parser==2.0.0 diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index cc449ffc4..9bcec5014 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -23,7 +23,7 @@ djangorestframework-stubs[compatible-mypy]==3.14.5 # https://github.com/typeddj # Documentation # ------------------------------------------------------------------------------ -sphinx==7.3.5 # https://github.com/sphinx-doc/sphinx +sphinx==7.3.6 # https://github.com/sphinx-doc/sphinx sphinx-autobuild==2024.4.16 # https://github.com/GaretJax/sphinx-autobuild # Code quality From 0e71fa21b693f1aa4387137cef6f27c22290751b Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 18 Apr 2024 00:56:10 -0700 Subject: [PATCH 216/234] Update celery from 5.3.6 to 5.4.0 (#5005) --- {{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 8f93227f7..1e4bba273 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -16,7 +16,7 @@ redis==5.0.3 # https://github.com/redis/redis-py hiredis==2.3.2 # https://github.com/redis/hiredis-py {%- endif %} {%- if cookiecutter.use_celery == "y" %} -celery==5.3.6 # pyup: < 6.0 # https://github.com/celery/celery +celery==5.4.0 # pyup: < 6.0 # https://github.com/celery/celery django-celery-beat==2.6.0 # https://github.com/celery/django-celery-beat {%- if cookiecutter.use_docker == 'y' %} flower==2.0.1 # https://github.com/mher/flower From fd3acfc11ffbb9fee6bcf19d46966908565d18cf Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 19 Apr 2024 02:13:53 +0000 Subject: [PATCH 217/234] Release 2024.04.18 --- CHANGELOG.md | 9 +++++++++ setup.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 422722602..e010612e6 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.04.18 + + +### Updated + +- Update celery to 5.4.0 ([#5005](https://github.com/cookiecutter/cookiecutter-django/pull/5005)) + +- Update sphinx to 7.3.6 ([#5004](https://github.com/cookiecutter/cookiecutter-django/pull/5004)) + ## 2024.04.17 diff --git a/setup.py b/setup.py index 30f85acd6..a725adb53 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.17" +version = "2024.04.18" with open("README.md") as readme_file: long_description = readme_file.read() From ee6de7951fdfe2034cd28012668ed1a416e9078c Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 19 Apr 2024 01:06:15 -0700 Subject: [PATCH 218/234] Update sphinx to 7.3.7 (#5010) * Update sphinx from 7.3.6 to 7.3.7 * Update sphinx from 7.3.6 to 7.3.7 --- docs/requirements.txt | 2 +- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index efad5ede7..119a44527 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,3 @@ -sphinx==7.3.6 +sphinx==7.3.7 sphinx-rtd-theme==2.0.0 myst-parser==2.0.0 diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 9bcec5014..134b2a562 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -23,7 +23,7 @@ djangorestframework-stubs[compatible-mypy]==3.14.5 # https://github.com/typeddj # Documentation # ------------------------------------------------------------------------------ -sphinx==7.3.6 # https://github.com/sphinx-doc/sphinx +sphinx==7.3.7 # https://github.com/sphinx-doc/sphinx sphinx-autobuild==2024.4.16 # https://github.com/GaretJax/sphinx-autobuild # Code quality From e686ab12717447fe790ab83e306070c2606ed5d3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 09:06:47 +0100 Subject: [PATCH 219/234] Auto-update pre-commit hooks (#5008) 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 df0e358c7..c8f15363d 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.3.7 + rev: v0.4.0 hooks: # Linter - id: ruff From 44c94a2cf695e0fa7d0d74e88757d2430f79da28 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 19 Apr 2024 01:06:56 -0700 Subject: [PATCH 220/234] Update ruff to 0.4.0 (#5007) * Update ruff from 0.3.7 to 0.4.0 * Update ruff from 0.3.7 to 0.4.0 --- 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 5da67bc34..637578284 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -ruff==0.3.7 +ruff==0.4.0 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 134b2a562..562f24beb 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.3.7 # https://github.com/astral-sh/ruff +ruff==0.4.0 # https://github.com/astral-sh/ruff coverage==7.4.4 # 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 c9d64fad62020259e370440608c482e44815fa50 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 19 Apr 2024 11:08:32 -0700 Subject: [PATCH 221/234] Update ruff to 0.4.1 (#5011) * Update ruff from 0.4.0 to 0.4.1 * Update ruff from 0.4.0 to 0.4.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 637578284..b97f6ef50 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -ruff==0.4.0 +ruff==0.4.1 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 562f24beb..12724a65d 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.0 # https://github.com/astral-sh/ruff +ruff==0.4.1 # https://github.com/astral-sh/ruff coverage==7.4.4 # 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 83d3e6f83dd2fd0df71c2eb4e7059f7e580bffe5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 20 Apr 2024 02:11:16 +0000 Subject: [PATCH 222/234] Release 2024.04.19 --- CHANGELOG.md | 13 +++++++++++++ setup.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e010612e6..2b7e8ea8e 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.04.19 + + +### Updated + +- Update ruff to 0.4.1 ([#5011](https://github.com/cookiecutter/cookiecutter-django/pull/5011)) + +- Update ruff to 0.4.0 ([#5007](https://github.com/cookiecutter/cookiecutter-django/pull/5007)) + +- Auto-update pre-commit hooks ([#5008](https://github.com/cookiecutter/cookiecutter-django/pull/5008)) + +- Update sphinx to 7.3.7 ([#5010](https://github.com/cookiecutter/cookiecutter-django/pull/5010)) + ## 2024.04.18 diff --git a/setup.py b/setup.py index a725adb53..e7a903e4a 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.18" +version = "2024.04.19" with open("README.md") as readme_file: long_description = readme_file.read() From 9006d6905501f228b0f8a5a3c840f29e93a94b79 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 20 Apr 2024 04:59:58 -0700 Subject: [PATCH 223/234] Update pytest-xdist from 3.5.0 to 3.6.0 (#5013) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b97f6ef50..87a86fd70 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,7 @@ pre-commit==3.7.0 # ------------------------------------------------------------------------------ tox==4.14.2 pytest==8.1.1 -pytest-xdist==3.5.0 +pytest-xdist==3.6.0 pytest-cookies==0.7.0 pytest-instafail==0.5.0 pyyaml==6.0.1 From af9cfc5002a47c22aa1dd01c24047eb67d99bf9c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 20 Apr 2024 15:43:32 +0100 Subject: [PATCH 224/234] Auto-update pre-commit hooks (#5014) 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 c8f15363d..4f7311fae 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.0 + rev: v0.4.1 hooks: # Linter - id: ruff From 929992e6d84c74d8a6ede8ab1ad9324a0ce46f88 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 21 Apr 2024 02:14:34 +0000 Subject: [PATCH 225/234] Release 2024.04.20 --- CHANGELOG.md | 9 +++++++++ setup.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b7e8ea8e..3c7f47b41 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.04.20 + + +### Updated + +- Auto-update pre-commit hooks ([#5014](https://github.com/cookiecutter/cookiecutter-django/pull/5014)) + +- Update pytest-xdist to 3.6.0 ([#5013](https://github.com/cookiecutter/cookiecutter-django/pull/5013)) + ## 2024.04.19 diff --git a/setup.py b/setup.py index e7a903e4a..25ddcdb28 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.19" +version = "2024.04.20" with open("README.md") as readme_file: long_description = readme_file.read() From b15cae614acce04b15bb5d399fe18173cb909fe0 Mon Sep 17 00:00:00 2001 From: Ryan Fitch <6692977+ryfi@users.noreply.github.com> Date: Mon, 22 Apr 2024 02:10:25 -0700 Subject: [PATCH 226/234] Fix broken link for sphinx-doc in generated docs (#5015) --- {{cookiecutter.project_slug}}/docs/howto.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/docs/howto.rst b/{{cookiecutter.project_slug}}/docs/howto.rst index 7d86351cf..2d734ceb2 100644 --- a/{{cookiecutter.project_slug}}/docs/howto.rst +++ b/{{cookiecutter.project_slug}}/docs/howto.rst @@ -26,7 +26,7 @@ Changes to files in `docs/_source` will be picked up and reloaded automatically. Docstrings to Documentation ---------------------------------------------------------------------- -The sphinx extension `apidoc `_ is used to automatically document code using signatures and docstrings. +The sphinx extension `apidoc `_ is used to automatically document code using signatures and docstrings. Numpy or Google style docstrings will be picked up from project files and available for documentation. See the `Napoleon `_ extension for details. From 1111c1afa5a8abaefa2a7c6c26d40f05b7167b93 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 23 Apr 2024 02:13:59 +0000 Subject: [PATCH 227/234] Release 2024.04.22 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c7f47b41..60babab0c 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.04.22 + + +### Fixed + +- Fix broken link for sphinx-doc in generated docs ([#5015](https://github.com/cookiecutter/cookiecutter-django/pull/5015)) + ## 2024.04.20 diff --git a/setup.py b/setup.py index 25ddcdb28..64909a1aa 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.20" +version = "2024.04.22" with open("README.md") as readme_file: long_description = readme_file.read() From 1b42f65b0336777881d2c62f621313dd1688e84b Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 23 Apr 2024 02:17:53 -0700 Subject: [PATCH 228/234] Update django-allauth to 0.62.0 (#5016) --- {{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 1e4bba273..2147f8d22 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.11 # 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.61.1 # https://github.com/pennersr/django-allauth +django-allauth[mfa]==0.62.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 d5d41fc7569a6236217c9c47ec917e629adef78f Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 23 Apr 2024 08:59:41 -0700 Subject: [PATCH 229/234] Update myst-parser to 3.0.0 (#5017) --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 119a44527..f84dbf045 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,3 @@ sphinx==7.3.7 sphinx-rtd-theme==2.0.0 -myst-parser==2.0.0 +myst-parser==3.0.0 From 89acf137f5bf2b6d43fae4cc143b62a60a905114 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 23 Apr 2024 11:48:43 -0700 Subject: [PATCH 230/234] Update redis from 5.0.3 to 5.0.4 (#5018) --- {{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 2147f8d22..a9684bedd 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -11,7 +11,7 @@ argon2-cffi==23.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==6.6.0 # https://github.com/evansd/whitenoise {%- endif %} -redis==5.0.3 # https://github.com/redis/redis-py +redis==5.0.4 # https://github.com/redis/redis-py {%- if cookiecutter.use_docker == "y" or cookiecutter.windows == "n" %} hiredis==2.3.2 # https://github.com/redis/hiredis-py {%- endif %} From d4bad0c3066f3d1fc1d7de4b4f2df1a627fa49e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20C=2E=20Barrionuevo=20da=20Luz?= Date: Tue, 23 Apr 2024 17:54:47 -0300 Subject: [PATCH 231/234] Update link to djlint on pyproject.toml (#5019) --- {{cookiecutter.project_slug}}/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index b62923747..a53e6c1f1 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -45,7 +45,7 @@ blank_line_after_tag = "load,extends" close_void_tags = true format_css = true format_js = true -# TODO: remove T002 when fixed https://github.com/Riverside-Healthcare/djLint/issues/687 +# TODO: remove T002 when fixed https://github.com/djlint/djLint/issues/687 ignore = "H006,H030,H031,T002" include = "H017,H035" indent = 2 From ae52c62692f24ceff89d78a86c7eed389dc59e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20C=2E=20Barrionuevo=20da=20Luz?= Date: Tue, 23 Apr 2024 18:28:45 -0300 Subject: [PATCH 232/234] Disable UP038 Ruff rule --- {{cookiecutter.project_slug}}/pyproject.toml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index a53e6c1f1..31e290dff 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -150,11 +150,20 @@ select = [ ignore = [ "S101", # Use of assert detected https://docs.astral.sh/ruff/rules/assert/ "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` - "SIM102" # sometimes it's better to nest + "SIM102", # sometimes it's better to nest + "UP038" # Checks for uses of isinstance/issubclass that take a tuple + # of types for comparison. + # Deactivated because it can make the code slow: + # https://github.com/astral-sh/ruff/issues/7871 ] # Allow fix for all enabled rules (when `--fix`) is provided. fixable = ["ALL"] unfixable = [] +# The fixes in extend-unsafe-fixes will require +# provide the `--unsafe-fixes` flag when fixing. +extend-unsafe-fixes = [ + "UP038" +] # Allow unused variables when underscore-prefixed. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" From 3f5f90e0026076cd0cf001872ae9803bb3586c75 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 24 Apr 2024 02:13:06 +0000 Subject: [PATCH 233/234] Release 2024.04.23 --- CHANGELOG.md | 13 +++++++++++++ setup.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60babab0c..383db8d98 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.04.23 + + +### Changed + +- Update link to djlint on pyproject.toml ([#5019](https://github.com/cookiecutter/cookiecutter-django/pull/5019)) + +### Updated + +- Update redis to 5.0.4 ([#5018](https://github.com/cookiecutter/cookiecutter-django/pull/5018)) + +- Update django-allauth to 0.62.0 ([#5016](https://github.com/cookiecutter/cookiecutter-django/pull/5016)) + ## 2024.04.22 diff --git a/setup.py b/setup.py index 64909a1aa..5d8ad95c5 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.22" +version = "2024.04.23" with open("README.md") as readme_file: long_description = readme_file.read() From 090153079e9a84c96ccb7f5cfb769c72c38cdded Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 24 Apr 2024 06:37:59 -0700 Subject: [PATCH 234/234] Update django-allauth from 0.62.0 to 0.62.1 (#5021) --- {{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 a9684bedd..46ab19843 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.11 # 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.0 # https://github.com/pennersr/django-allauth +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 {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %}