diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 23ca7a37f..5d7d9f9ca 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,5 +1,5 @@ # These are supported funding model platforms -github: [pydanny, browniebroke] +github: [pydanny, browniebroke, luzfcb] patreon: feldroy open_collective: cookiecutter-django diff --git a/.github/contributors.json b/.github/contributors.json index 6ee3192fb..7f2d3d468 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1593,5 +1593,10 @@ "name": "Manas Mallick", "github_login": "ManDun", "twitter_username": "" + }, + { + "name": "Alexandr Artemyev", + "github_login": "Mogost", + "twitter_username": "MOGOST" } ] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c81f51ec0..acf7676ec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,7 +43,7 @@ repos: - id: isort - repo: https://github.com/PyCQA/flake8 - rev: 7.0.0 + rev: 7.1.0 hooks: - id: flake8 diff --git a/CHANGELOG.md b/CHANGELOG.md index 39a1e2e80..6d2e5371e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,54 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.06.15 + + +### Changed + +- Update start-flower in flower to wait until all celery workers are online ([#5012](https://github.com/cookiecutter/cookiecutter-django/pull/5012)) + +- Enhancing the security of cookies ([#5102](https://github.com/cookiecutter/cookiecutter-django/pull/5102)) + +### Updated + +- Update django-crispy-forms to 2.2 ([#5143](https://github.com/cookiecutter/cookiecutter-django/pull/5143)) + +- Update sentry-sdk to 2.5.1 ([#5142](https://github.com/cookiecutter/cookiecutter-django/pull/5142)) + +- Auto-update pre-commit hooks ([#5140](https://github.com/cookiecutter/cookiecutter-django/pull/5140)) + +- Update django-allauth to 0.63.3 ([#5111](https://github.com/cookiecutter/cookiecutter-django/pull/5111)) + +## 2024.06.14 + + +### Updated + +- Bump python from 3.12.3-slim-bookworm to 3.12.4-slim-bookworm in /{{cookiecutter.project_slug}}/compose/local/docs ([#5129](https://github.com/cookiecutter/cookiecutter-django/pull/5129)) + +- Bump python from 3.12.3-slim-bookworm to 3.12.4-slim-bookworm in /{{cookiecutter.project_slug}}/compose/local/django ([#5130](https://github.com/cookiecutter/cookiecutter-django/pull/5130)) + +- Bump python from 3.12.3-slim-bookworm to 3.12.4-slim-bookworm in /{{cookiecutter.project_slug}}/compose/production/django ([#5132](https://github.com/cookiecutter/cookiecutter-django/pull/5132)) + +- Bump amazon/aws-cli from 2.16.6 to 2.16.8 in /{{cookiecutter.project_slug}}/compose/production/aws ([#5138](https://github.com/cookiecutter/cookiecutter-django/pull/5138)) + +- Update ruff to 0.4.9 ([#5139](https://github.com/cookiecutter/cookiecutter-django/pull/5139)) + +## 2024.06.13 + + +### Updated + +- Update redis to 5.0.6 ([#5137](https://github.com/cookiecutter/cookiecutter-django/pull/5137)) + +## 2024.06.12 + + +### Updated + +- Bump amazon/aws-cli Docker image from 2.15.58 to 2.16.6 ([#5135](https://github.com/cookiecutter/cookiecutter-django/pull/5135)) + ## 2024.06.08 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 57263c3b3..06f31200b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -215,6 +215,13 @@ Listed in alphabetical order. + + Alexandr Artemyev + + Mogost + + MOGOST + Alvaro [Andor] diff --git a/requirements.txt b/requirements.txt index b2d8690c0..cd8a823f8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -ruff==0.4.8 +ruff==0.4.9 django-upgrade==1.18.0 djlint==1.34.1 pre-commit==3.7.1 diff --git a/setup.py b/setup.py index 4cc0bf346..e240446f8 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.06.08" +version = "2024.06.15" with open("README.md") as readme_file: long_description = readme_file.read() diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index a620b78e7..b47b091c8 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -39,7 +39,7 @@ repos: # Run the Ruff linter. - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.8 + rev: v0.4.9 hooks: # Linter - id: ruff diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index 88ccb7491..b085d990c 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.3-slim-bookworm as python +FROM docker.io/python:3.12.4-slim-bookworm as python # Python build stage FROM python as python-build-stage diff --git a/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start b/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start index b4783d2f0..cebb62203 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start +++ b/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start @@ -3,6 +3,14 @@ set -o errexit set -o nounset + +until timeout 10 celery -A config.celery_app inspect ping; do + >&2 echo "Celery workers not available" +done + +echo 'Starting flower' + + exec watchfiles --filter python celery.__main__.main \ --args \ "-A config.celery_app -b \"${CELERY_BROKER_URL}\" flower --basic_auth=\"${CELERY_FLOWER_USER}:${CELERY_FLOWER_PASSWORD}\"" diff --git a/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile index 35565042d..0fadd009b 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.3-slim-bookworm as python +FROM docker.io/python:3.12.4-slim-bookworm as python # Python build stage diff --git a/{{cookiecutter.project_slug}}/compose/production/aws/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/aws/Dockerfile index be01056d7..687c6d5cf 100644 --- a/{{cookiecutter.project_slug}}/compose/production/aws/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/aws/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/amazon/aws-cli:2.15.58 +FROM docker.io/amazon/aws-cli:2.16.8 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 671eb4635..ab83fcd8f 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.3-slim-bookworm as python +FROM docker.io/python:3.12.4-slim-bookworm as python # Python build stage FROM python as python-build-stage diff --git a/{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start b/{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start index 4180d6778..f903a05a2 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start +++ b/{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start @@ -4,6 +4,14 @@ set -o errexit set -o nounset + +until timeout 10 celery -A config.celery_app inspect ping; do + >&2 echo "Celery workers not available" +done + +echo 'Starting flower' + + exec celery \ -A config.celery_app \ -b "${CELERY_BROKER_URL}" \ diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 5a6cbdb1d..a650d8315 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -55,8 +55,12 @@ SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") SECURE_SSL_REDIRECT = env.bool("DJANGO_SECURE_SSL_REDIRECT", default=True) # https://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-secure SESSION_COOKIE_SECURE = True +# https://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-name +SESSION_COOKIE_NAME = "__Secure-sessionid" # https://docs.djangoproject.com/en/dev/ref/settings/#csrf-cookie-secure CSRF_COOKIE_SECURE = True +# https://docs.djangoproject.com/en/dev/ref/settings/#csrf-cookie-name +CSRF_COOKIE_NAME = "__Secure-csrftoken" # https://docs.djangoproject.com/en/dev/topics/security/#ssl-https # https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-seconds # TODO: set this to 60 seconds first and then to 518400 once you prove the former works diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index c13e3d164..2907abada 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -2,16 +2,16 @@ python-slugify==8.0.4 # https://github.com/un33k/python-slugify 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 +rcssmin==1.1.2 --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin {%- else %} -rcssmin==1.1.1 # https://github.com/ndparker/rcssmin +rcssmin==1.1.2 # https://github.com/ndparker/rcssmin {%- endif %} {%- endif %} 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.5 # https://github.com/redis/redis-py +redis==5.0.6 # 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 %} @@ -32,11 +32,11 @@ uvicorn-worker==0.2.0 # https://github.com/Kludex/uvicorn-worker django==4.2.13 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.11.2 # https://github.com/joke2k/django-environ django-model-utils==4.5.1 # https://github.com/jazzband/django-model-utils -django-allauth[mfa]==0.63.2 # https://github.com/pennersr/django-allauth -django-crispy-forms==2.1 # https://github.com/django-crispy-forms/django-crispy-forms +django-allauth[mfa]==0.63.3 # https://github.com/pennersr/django-allauth +django-crispy-forms==2.2 # 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' %} -django-compressor==4.4 # https://github.com/django-compressor/django-compressor +django-compressor==4.5 # https://github.com/django-compressor/django-compressor {%- endif %} django-redis==5.4.0 # https://github.com/jazzband/django-redis {%- if cookiecutter.use_drf == 'y' %} diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 398ba8024..89d049d0e 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -29,7 +29,7 @@ sphinx-rtd-theme==2.0.0 # https://pypi.org/project/sphinx-rtd-theme/ # Code quality # ------------------------------------------------------------------------------ -ruff==0.4.8 # https://github.com/astral-sh/ruff +ruff==0.4.9 # https://github.com/astral-sh/ruff coverage==7.5.3 # https://github.com/nedbat/coveragepy djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pre-commit==3.7.1 # https://github.com/pre-commit/pre-commit diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index f6f27308f..9a742a16a 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg[c]==3.1.19 # https://github.com/psycopg/psycopg Collectfast==2.2.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==2.5.0 # https://github.com/getsentry/sentry-python +sentry-sdk==2.5.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