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 7a029c764..2e40624f4 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": "" }, @@ -1473,5 +1473,130 @@ "name": "Jakub Boukal", "github_login": "SukiCZ", "twitter_username": "" + }, + { + "name": "Christian Jauvin", + "github_login": "cjauvin", + "twitter_username": "" + }, + { + "name": "Plurific", + "github_login": "paulschwenn", + "twitter_username": "" + }, + { + "name": "GitBib", + "github_login": "GitBib", + "twitter_username": "" + }, + { + "name": "Freddy", + "github_login": "Hraesvelg", + "twitter_username": "" + }, + { + "name": "aiden", + "github_login": "anyidea", + "twitter_username": "" + }, + { + "name": "Michael V. Battista", + "github_login": "mvbattista", + "twitter_username": "mvbattista" + }, + { + "name": "Nix Siow", + "github_login": "nixsiow", + "twitter_username": "nixsiow" + }, + { + "name": "Jens Kaeske", + "github_login": "jkaeske", + "twitter_username": "" + }, + { + "name": "henningbra", + "github_login": "henningbra", + "twitter_username": "" + }, + { + "name": "Paul Wulff", + "github_login": "mtmpaulwulff", + "twitter_username": "" + }, + { + "name": "Mounir", + "github_login": "mounirmesselmeni", + "twitter_username": "" + }, + { + "name": "JAEGYUN JUNG", + "github_login": "TGoddessana", + "twitter_username": "" + }, + { + "name": "Simeon Emanuilov", + "github_login": "s-emanuilov", + "twitter_username": "s_emanuilov" + }, + { + "name": "Patrick Zhang", + "github_login": "PatDuJour", + "twitter_username": "" + }, + { + "name": "GvS", + "github_login": "GvS666", + "twitter_username": "" + }, + { + "name": "David Păcioianu", + "github_login": "DavidPacioianu", + "twitter_username": "" + }, + { + "name": "farwill", + "github_login": "farwill", + "twitter_username": "" + }, + { + "name": "quroom", + "github_login": "quroom", + "twitter_username": "" + }, + { + "name": "Marios Frixou", + "github_login": "frixou89", + "twitter_username": "" + }, + { + "name": "Geo Maciolek", + "github_login": "GeoMaciolek", + "twitter_username": "" + }, + { + "name": "Nadav Peretz", + "github_login": "nadavperetz", + "twitter_username": "" + }, + { + "name": "Param Kapur", + "github_login": "paramkpr", + "twitter_username": "ParamKapur" + }, + { + "name": "Jason Mok", + "github_login": "jasonmokk", + "twitter_username": "" + }, + { + "name": "Manas Mallick", + "github_login": "ManDun", + "twitter_username": "" + }, + { + "name": "Alexandr Artemyev", + "github_login": "Mogost", + "twitter_username": "MOGOST" } ] \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7642a3f2d..3582a2125 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,13 +3,29 @@ 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: "/" schedule: interval: "daily" labels: - - "update" + - "project infrastructure" # Update npm packages - package-ecosystem: "npm" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17510ae25..1db462916 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,9 +23,9 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@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 @@ -54,9 +54,9 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@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 @@ -98,9 +98,9 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" cache: pip cache-dependency-path: | requirements.txt @@ -108,8 +108,8 @@ jobs: {{cookiecutter.project_slug}}/requirements/local.txt - name: Install dependencies run: pip install -r requirements.txt - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: "18" + node-version: "20" - name: Bare Metal ${{ matrix.script.name }} run: sh tests/test_bare.sh ${{ matrix.script.args }} diff --git a/.github/workflows/django-issue-checker.yml b/.github/workflows/django-issue-checker.yml index a926f7513..2185da81b 100644 --- a/.github/workflows/django-issue-checker.yml +++ b/.github/workflows/django-issue-checker.yml @@ -17,9 +17,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@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/issue-manager.yml b/.github/workflows/issue-manager.yml index a6e074137..103612cfe 100644 --- a/.github/workflows/issue-manager.yml +++ b/.github/workflows/issue-manager.yml @@ -23,18 +23,25 @@ jobs: runs-on: ubuntu-latest steps: - - uses: tiangolo/issue-manager@0.4.0 + - uses: tiangolo/issue-manager@0.5.0 with: token: ${{ secrets.GITHUB_TOKEN }} config: > { "answered": { + "delay": 864000, "message": "Assuming the question was answered, this will be automatically closed now." }, "solved": { + "delay": 864000, "message": "Assuming the original issue was solved, it will be automatically closed now." }, "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." } } diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml index 67fe9f94a..c01cd5141 100644 --- a/.github/workflows/pre-commit-autoupdate.yml +++ b/.github/workflows/pre-commit-autoupdate.yml @@ -22,9 +22,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - name: Install pre-commit run: pip install pre-commit @@ -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 diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index eb037b675..635d26f23 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: jobs: - release: + update: # Disables this workflow from running in a repository that is not part of the indicated organization/user if: github.repository_owner == 'cookiecutter' @@ -17,9 +17,9 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@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/update-contributors.yml b/.github/workflows/update-contributors.yml index 9b93ef6f1..c77bc5e8f 100644 --- a/.github/workflows/update-contributors.yml +++ b/.github/workflows/update-contributors.yml @@ -20,9 +20,9 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@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 @@ -33,7 +33,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4.16.0 + uses: stefanzweifel/git-auto-commit-action@v5.0.1 with: commit_message: Update Contributors file_pattern: CONTRIBUTORS.md .github/contributors.json diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1c4394073..c81f51ec0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,12 @@ exclude: "{{cookiecutter.project_slug}}|.github/contributors.json|CHANGELOG.md|CONTRIBUTORS.md" default_stages: [commit] +default_language_version: + python: python3.12 + repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -17,30 +20,30 @@ repos: - id: detect-private-key - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v3.0.3" + rev: "v4.0.0-alpha.8" hooks: - id: prettier args: ["--tab-width", "2"] - repo: https://github.com/asottile/pyupgrade - rev: v3.14.0 + rev: v3.16.0 hooks: - id: pyupgrade - args: [--py311-plus] + args: [--py312-plus] exclude: hooks/ - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 24.4.2 hooks: - id: black - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.0.0 hooks: - id: flake8 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" 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/CHANGELOG.md b/CHANGELOG.md index fa1d73a7f..6d2e5371e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,1396 @@ 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 + + +### Changed + +- Replace deprecated `uvicorn.workers` with `uvicorn-worker` ([#5110](https://github.com/cookiecutter/cookiecutter-django/pull/5110)) + +- Change aws-cli docker image to use official amazon image ([#5116](https://github.com/cookiecutter/cookiecutter-django/pull/5116)) + +## 2024.06.06 + + +### Updated + +- Update sentry-sdk to 2.5.0 ([#5126](https://github.com/cookiecutter/cookiecutter-django/pull/5126)) + +- Update ruff to 0.4.8 ([#5122](https://github.com/cookiecutter/cookiecutter-django/pull/5122)) + +- Update redis to 5.0.5 ([#5125](https://github.com/cookiecutter/cookiecutter-django/pull/5125)) + +## 2024.06.04 + + +### Updated + +- Update pytest to 8.2.2 ([#5120](https://github.com/cookiecutter/cookiecutter-django/pull/5120)) + +- Update sh to 2.0.7 ([#5114](https://github.com/cookiecutter/cookiecutter-django/pull/5114)) + +- Update sentry-sdk to 2.4.0 ([#5119](https://github.com/cookiecutter/cookiecutter-django/pull/5119)) + +## 2024.06.02 + + +### Updated + +- Update uvicorn to 0.30.1 ([#5115](https://github.com/cookiecutter/cookiecutter-django/pull/5115)) + +## 2024.06.01 + + +### Updated + +- Update ruff to 0.4.7 ([#5112](https://github.com/cookiecutter/cookiecutter-django/pull/5112)) + +## 2024.05.30 + + +### Updated + +- Update uvicorn to 0.30.0 ([#5101](https://github.com/cookiecutter/cookiecutter-django/pull/5101)) + +## 2024.05.29 + + +### Updated + +- Update requests to 2.32.3 ([#5108](https://github.com/cookiecutter/cookiecutter-django/pull/5108)) + +- Update ruff to 0.4.6 ([#5107](https://github.com/cookiecutter/cookiecutter-django/pull/5107)) + +- Auto-update pre-commit hooks ([#5106](https://github.com/cookiecutter/cookiecutter-django/pull/5106)) + +- Update coverage to 7.5.3 ([#5104](https://github.com/cookiecutter/cookiecutter-django/pull/5104)) + +- Update django-upgrade to 1.18.0 ([#5105](https://github.com/cookiecutter/cookiecutter-django/pull/5105)) + +## 2024.05.27 + + +### Changed + +- Rename SendInBlue ESP to Brevo ([#5094](https://github.com/cookiecutter/cookiecutter-django/pull/5094)) + +### Updated + +- Update django-stubs to 5.0.2 ([#5100](https://github.com/cookiecutter/cookiecutter-django/pull/5100)) + +- Update watchfiles to 0.22.0 ([#5099](https://github.com/cookiecutter/cookiecutter-django/pull/5099)) + +- Update django-allauth to 0.63.2 ([#5092](https://github.com/cookiecutter/cookiecutter-django/pull/5092)) + +- Update coverage to 7.5.2 ([#5095](https://github.com/cookiecutter/cookiecutter-django/pull/5095)) + +- Update django-debug-toolbar to 4.4.2 ([#5098](https://github.com/cookiecutter/cookiecutter-django/pull/5098)) + +## 2024.05.23 + + +### Updated + +- Update sentry-sdk to 2.3.1 ([#5091](https://github.com/cookiecutter/cookiecutter-django/pull/5091)) + +- Auto-update pre-commit hooks ([#5087](https://github.com/cookiecutter/cookiecutter-django/pull/5087)) + +- Update ruff to 0.4.5 ([#5086](https://github.com/cookiecutter/cookiecutter-django/pull/5086)) + +## 2024.05.21 + + +### Updated + +- Update sentry-sdk to 2.2.1 ([#5083](https://github.com/cookiecutter/cookiecutter-django/pull/5083)) + +## 2024.05.20 + + +### Fixed + +- Fix PyCharm Run Configurations After local.yml Rename ([#5080](https://github.com/cookiecutter/cookiecutter-django/pull/5080)) + +### Updated + +- Update pytest to 8.2.1 ([#5079](https://github.com/cookiecutter/cookiecutter-django/pull/5079)) + +## 2024.05.18 + + +### Fixed + +- Fix redirect error when forcing allauth login in admin site ([#5078](https://github.com/cookiecutter/cookiecutter-django/pull/5078)) + +## 2024.05.17 + + +### Updated + +- Update django-allauth to 0.63.1 ([#5076](https://github.com/cookiecutter/cookiecutter-django/pull/5076)) + +## 2024.05.16 + + +### Documentation + +- Update Two scoops of Django book link & image ([#5073](https://github.com/cookiecutter/cookiecutter-django/pull/5073)) + +### Updated + +- Update sentry-sdk to 2.2.0 ([#5074](https://github.com/cookiecutter/cookiecutter-django/pull/5074)) + +- Update django-allauth to 0.63.0 ([#5070](https://github.com/cookiecutter/cookiecutter-django/pull/5070)) + +## 2024.05.15 + + +### Fixed + +- Disable DDT profiling panel ([#5069](https://github.com/cookiecutter/cookiecutter-django/pull/5069)) + +## 2024.05.13 + + +### Changed + +- Rename docker compose files to include 'docker-compose' ([#4995](https://github.com/cookiecutter/cookiecutter-django/pull/4995)) + +- Remove obsolete `version` element from docker compose files ([#5059](https://github.com/cookiecutter/cookiecutter-django/pull/5059)) + +- Add Redis persistent storage when using celery ([#5063](https://github.com/cookiecutter/cookiecutter-django/pull/5063)) + +### Fixed + +- Add noqa to ignore ruff false positive ([#5068](https://github.com/cookiecutter/cookiecutter-django/pull/5068)) + +- Fix staticfile settings with cloud provider and whitenoise ([#5057](https://github.com/cookiecutter/cookiecutter-django/pull/5057)) + +### Updated + +- Update djangorestframework-stubs to 3.15.0 ([#5041](https://github.com/cookiecutter/cookiecutter-django/pull/5041)) + +- Update django-stubs to 5.0.0 ([#5040](https://github.com/cookiecutter/cookiecutter-django/pull/5040)) + +- Update mypy to 1.10.0 ([#5022](https://github.com/cookiecutter/cookiecutter-django/pull/5022)) + +- Update werkzeug to 3.0.3 ([#5050](https://github.com/cookiecutter/cookiecutter-django/pull/5050)) + +## 2024.05.11 + + +### Updated + +- Update pre-commit to 3.7.1 ([#5066](https://github.com/cookiecutter/cookiecutter-django/pull/5066)) + +- Auto-update pre-commit hooks ([#5067](https://github.com/cookiecutter/cookiecutter-django/pull/5067)) + +## 2024.05.10 + + +### Updated + +- Update psycopg to 3.1.19 ([#5064](https://github.com/cookiecutter/cookiecutter-django/pull/5064)) + +- Update django-upgrade to 1.17.0 ([#5065](https://github.com/cookiecutter/cookiecutter-django/pull/5065)) + +- Auto-update pre-commit hooks ([#5062](https://github.com/cookiecutter/cookiecutter-django/pull/5062)) + +- Update ruff to 0.4.4 ([#5061](https://github.com/cookiecutter/cookiecutter-django/pull/5061)) + +## 2024.05.07 + + +### Updated + +- Update django to 4.2.13 ([#5058](https://github.com/cookiecutter/cookiecutter-django/pull/5058)) + +## 2024.05.06 + + +### Fixed + +- Fix nginx image name in production.yml ([#5053](https://github.com/cookiecutter/cookiecutter-django/pull/5053)) + +### Updated + +- Update django-model-utils to 4.5.1 ([#5044](https://github.com/cookiecutter/cookiecutter-django/pull/5044)) + +- Update django to 4.2.12 ([#5056](https://github.com/cookiecutter/cookiecutter-django/pull/5056)) + +- Update sentry-sdk to 2.1.1 ([#5055](https://github.com/cookiecutter/cookiecutter-django/pull/5055)) + +- Update ruff to 0.4.3 ([#5049](https://github.com/cookiecutter/cookiecutter-django/pull/5049)) + +## 2024.05.05 + + +### Updated + +- Auto-update pre-commit hooks ([#5046](https://github.com/cookiecutter/cookiecutter-django/pull/5046)) + +- Update django-storages to 1.14.3 ([#5047](https://github.com/cookiecutter/cookiecutter-django/pull/5047)) + +- Update coverage to 7.5.1 ([#5048](https://github.com/cookiecutter/cookiecutter-django/pull/5048)) + +## 2024.04.28 + + +### Updated + +- Update pytest to 8.2.0 ([#5034](https://github.com/cookiecutter/cookiecutter-django/pull/5034)) + +## 2024.04.27 + + +### Updated + +- Update sentry-sdk to 2.0.1 ([#5030](https://github.com/cookiecutter/cookiecutter-django/pull/5030)) + +## 2024.04.26 + + +### Updated + +- Auto-update pre-commit hooks ([#5029](https://github.com/cookiecutter/cookiecutter-django/pull/5029)) + +- Update ruff to 0.4.2 ([#5028](https://github.com/cookiecutter/cookiecutter-django/pull/5028)) + +## 2024.04.25 + + +### Updated + +- Update coverage to 7.5.0 ([#5025](https://github.com/cookiecutter/cookiecutter-django/pull/5025)) + +- Bump cssnano from 6.1.2 to 7.0.0 ([#5024](https://github.com/cookiecutter/cookiecutter-django/pull/5024)) + +- Auto-update pre-commit hooks ([#5023](https://github.com/cookiecutter/cookiecutter-django/pull/5023)) + +## 2024.04.24 + + +### Changed + +- Disable UP038 Ruff rule to avoid introducing slower code ([#5020](https://github.com/cookiecutter/cookiecutter-django/pull/5020)) + +### Updated + +- Update django-allauth to 0.62.1 ([#5021](https://github.com/cookiecutter/cookiecutter-django/pull/5021)) + +## 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 + + +### Fixed + +- Fix broken link for sphinx-doc in generated docs ([#5015](https://github.com/cookiecutter/cookiecutter-django/pull/5015)) + +## 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 + + +### 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 + + +### 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 + + +### 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 + + +### 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 + + +### 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 + + +### Documentation + +- Fix start command for docs ([#4978](https://github.com/cookiecutter/cookiecutter-django/pull/4978)) + +## 2024.04.07 + + +### Updated + +- Auto-update pre-commit hooks ([#4974](https://github.com/cookiecutter/cookiecutter-django/pull/4974)) + +## 2024.04.06 + + +### Fixed + +- Fix syntax error in GitHub CI workflow ([#4972](https://github.com/cookiecutter/cookiecutter-django/pull/4972)) + +## 2024.04.05 + + +### Updated + +- Update django-webpack-loader to 3.1.0 ([#4965](https://github.com/cookiecutter/cookiecutter-django/pull/4965)) + +## 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 + + +### 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 + + +### Documentation + +- Add instruction for adding a django app ([#4944](https://github.com/cookiecutter/cookiecutter-django/pull/4944)) + +## 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 + + +### Documentation + +- Update mentions of psycopg in comments ([#4947](https://github.com/cookiecutter/cookiecutter-django/pull/4947)) + +## 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 + + +### 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 + + +### 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 + + +### Updated + +- Update djangorestframework to 3.15.0 ([#4929](https://github.com/cookiecutter/cookiecutter-django/pull/4929)) + +## 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 + + +### 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 + + +### Fixed + +- Fix fully qualified docker images ([#4905](https://github.com/cookiecutter/cookiecutter-django/pull/4905)) + +## 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 + + +### Updated + +- Update django-celery-beat to 2.6.0 ([#4899](https://github.com/cookiecutter/cookiecutter-django/pull/4899)) + +## 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 + + +### 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 + + +### 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 + + +### Updated + +- Update coverage to 7.4.3 ([#4888](https://github.com/cookiecutter/cookiecutter-django/pull/4888)) + +## 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 + + +### 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 + + +### Updated + +- Update sentry-sdk to 1.40.5 ([#4876](https://github.com/cookiecutter/cookiecutter-django/pull/4876)) + +## 2024.02.17 + + +### Updated + +- Update pytest to 8.0.1 ([#4870](https://github.com/cookiecutter/cookiecutter-django/pull/4870)) + +## 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 + + +### 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 + + +### 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 + + +### 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 + + +### 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 + + +### 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 + + +### 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 + + +### Updated + +- Update python-slugify to 8.0.3 ([#4826](https://github.com/cookiecutter/cookiecutter-django/pull/4826)) + +## 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 + + +### 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 + + +### 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 + + +### Updated + +- Update black to 24.1.0 ([#4806](https://github.com/cookiecutter/cookiecutter-django/pull/4806)) + +## 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 + + +### 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 + + +### Documentation + +- Update traefik doc links ([#4798](https://github.com/cookiecutter/cookiecutter-django/pull/4798)) + +### Updated + +- Bump browser-sync from 2.29.3 to 3.0.2 in /{{cookiecutter.project_slug}} ([#4765](https://github.com/cookiecutter/cookiecutter-django/pull/4765)) + +## 2024.01.19 + + +### Updated + +- Update drf-spectacular to 0.27.1 ([#4797](https://github.com/cookiecutter/cookiecutter-django/pull/4797)) + +## 2024.01.17 + + +### Changed + +- Add a test to cover `DJANGO_ADMIN_FORCE_ALLAUTH` ([#4790](https://github.com/cookiecutter/cookiecutter-django/pull/4790)) + +### Updated + +- Bump webpack-bundle-tracker to 3.0.1 ([#4781](https://github.com/cookiecutter/cookiecutter-django/pull/4781)) + +- Update django-webpack-loader to 3.0.1 ([#4793](https://github.com/cookiecutter/cookiecutter-django/pull/4793)) + +- Bump postcss-loader to 8.0.0 ([#4795](https://github.com/cookiecutter/cookiecutter-django/pull/4795)) + +- Update uvicorn to 0.26.0 ([#4794](https://github.com/cookiecutter/cookiecutter-django/pull/4794)) + +## 2024.01.16 + + +### Updated + +- Bump sass-loader from 13.3.3 to 14.0.0 in /{{cookiecutter.project_slug}} ([#4791](https://github.com/cookiecutter/cookiecutter-django/pull/4791)) + +## 2024.01.15 + + +### Documentation + +- Update allauth documentation links ([#4786](https://github.com/cookiecutter/cookiecutter-django/pull/4786)) + +### Updated + +- Update django-allauth to 0.60.1 ([#4787](https://github.com/cookiecutter/cookiecutter-django/pull/4787)) + +## 2024.01.11 + + +### Updated + +- Update jinja2 to 3.1.3 ([#4784](https://github.com/cookiecutter/cookiecutter-django/pull/4784)) + +## 2024.01.10 + + +### Updated + +- Update sentry-sdk to 1.39.2 ([#4782](https://github.com/cookiecutter/cookiecutter-django/pull/4782)) + +## 2024.01.09 + + +### Documentation + +- Update allauth settings documentation links ([#4769](https://github.com/cookiecutter/cookiecutter-django/pull/4769)) + +### Updated + +- Update django-allauth to 0.60.0 ([#4776](https://github.com/cookiecutter/cookiecutter-django/pull/4776)) + +- Update psycopg to 3.1.17 ([#4777](https://github.com/cookiecutter/cookiecutter-django/pull/4777)) + +## 2024.01.05 + + +### Updated + +- Auto-update pre-commit hooks ([#4774](https://github.com/cookiecutter/cookiecutter-django/pull/4774)) + +- Update flake8 to 7.0.0 ([#4775](https://github.com/cookiecutter/cookiecutter-django/pull/4775)) + +## 2024.01.02 + + +### Updated + +- Update psycopg to 3.1.16 ([#4753](https://github.com/cookiecutter/cookiecutter-django/pull/4753)) + +- Update djlint to 1.34.1 ([#4773](https://github.com/cookiecutter/cookiecutter-django/pull/4773)) + +- Update uvicorn to 0.25.0 ([#4760](https://github.com/cookiecutter/cookiecutter-django/pull/4760)) + +- Auto-update pre-commit hooks ([#4749](https://github.com/cookiecutter/cookiecutter-django/pull/4749)) + +- Update black to 23.12.1 ([#4772](https://github.com/cookiecutter/cookiecutter-django/pull/4772)) + +- Update pillow to 10.2.0 ([#4770](https://github.com/cookiecutter/cookiecutter-django/pull/4770)) + +- Update django to 4.2.9 ([#4771](https://github.com/cookiecutter/cookiecutter-django/pull/4771)) + +- Update pytest to 7.4.4 ([#4767](https://github.com/cookiecutter/cookiecutter-django/pull/4767)) + +- Update coverage to 7.4.0 ([#4764](https://github.com/cookiecutter/cookiecutter-django/pull/4764)) + +## 2023.12.19 + + +### Changed + +- Upgrade debian to 12 bookworm ([#4745](https://github.com/cookiecutter/cookiecutter-django/pull/4745)) + +### Updated + +- Update hiredis to 2.3.2 ([#4750](https://github.com/cookiecutter/cookiecutter-django/pull/4750)) + +## 2023.12.15 + + +### Updated + +- Update coverage to 7.3.3 ([#4748](https://github.com/cookiecutter/cookiecutter-django/pull/4748)) + +- Update psycopg to 3.1.15 ([#4747](https://github.com/cookiecutter/cookiecutter-django/pull/4747)) + +- Update sentry-sdk to 1.39.1 ([#4746](https://github.com/cookiecutter/cookiecutter-django/pull/4746)) + +- Auto-update pre-commit hooks ([#4743](https://github.com/cookiecutter/cookiecutter-django/pull/4743)) + +## 2023.12.13 + + +### Updated + +- Auto-update pre-commit hooks ([#4740](https://github.com/cookiecutter/cookiecutter-django/pull/4740)) + +## 2023.12.12 + + +### Updated + +- Update django-allauth to 0.59.0 ([#4739](https://github.com/cookiecutter/cookiecutter-django/pull/4739)) + +- Update sentry-sdk to 1.39.0 ([#4738](https://github.com/cookiecutter/cookiecutter-django/pull/4738)) + +- Update black to 23.12.0 ([#4737](https://github.com/cookiecutter/cookiecutter-django/pull/4737)) + +- Auto-update pre-commit hooks ([#4736](https://github.com/cookiecutter/cookiecutter-django/pull/4736)) + +- Update drf-spectacular to 0.27.0 ([#4735](https://github.com/cookiecutter/cookiecutter-django/pull/4735)) + +## 2023.12.11 + + +### Updated + +- Auto-update pre-commit hooks ([#4730](https://github.com/cookiecutter/cookiecutter-django/pull/4730)) + +## 2023.12.10 + + +### Updated + +- Update pre-commit to 3.6.0 ([#4728](https://github.com/cookiecutter/cookiecutter-django/pull/4728)) + +- Auto-update pre-commit hooks ([#4729](https://github.com/cookiecutter/cookiecutter-django/pull/4729)) + +## 2023.12.09 + + +### Changed + +- Add missing __init__.py file to api module ([#4726](https://github.com/cookiecutter/cookiecutter-django/pull/4726)) + +## 2023.12.07 + + +### Updated + +- Bump actions/setup-python from 4 to 5 ([#4723](https://github.com/cookiecutter/cookiecutter-django/pull/4723)) + +- Auto-update pre-commit hooks ([#4709](https://github.com/cookiecutter/cookiecutter-django/pull/4709)) + +- Bump traefik from 2.10.6 to 2.10.7 ([#4722](https://github.com/cookiecutter/cookiecutter-django/pull/4722)) + +## 2023.12.06 + + +### Updated + +- Bump python from 3.11.6 to 3.11.7 ([#4719](https://github.com/cookiecutter/cookiecutter-django/pull/4719)) + +- Update mypy to 1.7.1, django-stubs to 4.2.7 and djangorestframework-stubs to 3.14.5 ([#4694](https://github.com/cookiecutter/cookiecutter-django/pull/4694)) + +## 2023.12.04 + + +### Updated + +- Update django to 4.2.8 ([#4713](https://github.com/cookiecutter/cookiecutter-django/pull/4713)) + +- Bump node from 18 to 20 ([#4283](https://github.com/cookiecutter/cookiecutter-django/pull/4283)) + +- Update psycopg to 3.1.14 ([#4711](https://github.com/cookiecutter/cookiecutter-django/pull/4711)) + +## 2023.12.02 + + +### Updated + +- Update mailpit to latest ([#4710](https://github.com/cookiecutter/cookiecutter-django/pull/4710)) + +## 2023.11.30 + + +### Fixed + +- Removed tmp mount in devcontainer.json. Fix #4686 ([#4708](https://github.com/cookiecutter/cookiecutter-django/pull/4708)) + +### Updated + +- Bump traefik from 2.10.5 to 2.10.6 ([#4706](https://github.com/cookiecutter/cookiecutter-django/pull/4706)) + +## 2023.11.29 + + +### Updated + +- Update sentry-sdk to 1.38.0 ([#4705](https://github.com/cookiecutter/cookiecutter-django/pull/4705)) + +## 2023.11.28 + + +### Fixed + +- Excludes devcontainer.json from the pre-commit ([#4702](https://github.com/cookiecutter/cookiecutter-django/pull/4702)) + +### Updated + +- Update sphinx-rtd-theme to 2.0.0 ([#4700](https://github.com/cookiecutter/cookiecutter-django/pull/4700)) + +## 2023.11.24 + + +### Updated + +- Update sentry-sdk to 1.37.1 ([#4696](https://github.com/cookiecutter/cookiecutter-django/pull/4696)) + +- Update sentry-sdk to 1.37.0 ([#4695](https://github.com/cookiecutter/cookiecutter-django/pull/4695)) + +## 2023.11.22 + + +### Updated + +- Update celery to 5.3.6 ([#4693](https://github.com/cookiecutter/cookiecutter-django/pull/4693)) + +## 2023.11.21 + + +### Updated + +- Update sentry-sdk to 1.36.0 ([#4687](https://github.com/cookiecutter/cookiecutter-django/pull/4687)) + +## 2023.11.20 + + +### Fixed + +- Fix bug with social account adapter name override, in very specific conditions ([#4650](https://github.com/cookiecutter/cookiecutter-django/pull/4650)) + +### Updated + +- Update django-cors-headers to 4.3.1 ([#4684](https://github.com/cookiecutter/cookiecutter-django/pull/4684)) + +- Update psycopg to 3.1.13 ([#4685](https://github.com/cookiecutter/cookiecutter-django/pull/4685)) + +## 2023.11.14 + + +### Updated + +- Update sentry-sdk to 1.35.0 ([#4681](https://github.com/cookiecutter/cookiecutter-django/pull/4681)) + +- Auto-update pre-commit hooks ([#4683](https://github.com/cookiecutter/cookiecutter-django/pull/4683)) + +## 2023.11.11 + + +### Updated + +- Update celery to 5.3.5 ([#4678](https://github.com/cookiecutter/cookiecutter-django/pull/4678)) + +## 2023.11.09 + + +### Updated + +- Auto-update pre-commit hooks ([#4673](https://github.com/cookiecutter/cookiecutter-django/pull/4673)) + +- Update black to 23.11.0 ([#4674](https://github.com/cookiecutter/cookiecutter-django/pull/4674)) + +## 2023.11.08 + + +### Updated + +- Update pytest-django to 4.7.0 ([#4672](https://github.com/cookiecutter/cookiecutter-django/pull/4672)) + +## 2023.11.06 + + +### Changed + +- Add `rmbackup` script to remove backups from `postgres/backups`. Fixes: #4663 ([#4664](https://github.com/cookiecutter/cookiecutter-django/pull/4664)) + +### Updated + +- Update django-allauth to 0.58.2 ([#4667](https://github.com/cookiecutter/cookiecutter-django/pull/4667)) + +- Update uvicorn to 0.24.0.post1 ([#4666](https://github.com/cookiecutter/cookiecutter-django/pull/4666)) + +## 2023.11.04 + + +### Updated + +- Update uvicorn to 0.24.0 ([#4665](https://github.com/cookiecutter/cookiecutter-django/pull/4665)) + +## 2023.11.03 + + +### Updated + +- Update flake8-isort to 6.1.1 ([#4662](https://github.com/cookiecutter/cookiecutter-django/pull/4662)) + +## 2023.11.02 + + +### Updated + +- Update sentry-sdk to 1.34.0 ([#4660](https://github.com/cookiecutter/cookiecutter-django/pull/4660)) + +## 2023.11.01 + + +### Updated + +- Update django to 4.2.7 ([#4658](https://github.com/cookiecutter/cookiecutter-django/pull/4658)) + +- Update django-stubs to 4.2.6 ([#4657](https://github.com/cookiecutter/cookiecutter-django/pull/4657)) + +## 2023.10.31 + + +### Updated + +- Update pytest-django to 4.6.0 ([#4656](https://github.com/cookiecutter/cookiecutter-django/pull/4656)) + +- Update pytest to 7.4.3 ([#4654](https://github.com/cookiecutter/cookiecutter-django/pull/4654)) + +- Update werkzeug to 3.0.1 ([#4655](https://github.com/cookiecutter/cookiecutter-django/pull/4655)) + +- Update sentry-sdk to 1.33.1 ([#4653](https://github.com/cookiecutter/cookiecutter-django/pull/4653)) + +- Update sentry-sdk to 1.33.0 ([#4652](https://github.com/cookiecutter/cookiecutter-django/pull/4652)) + +- Update crispy-bootstrap5 to 2023.10 ([#4651](https://github.com/cookiecutter/cookiecutter-django/pull/4651)) + +## 2023.10.26 + + +### Updated + +- Update django-anymail to 10.2 ([#4645](https://github.com/cookiecutter/cookiecutter-django/pull/4645)) + +## 2023.10.24 + + +### Updated + +- Update black to 23.10.1 ([#4639](https://github.com/cookiecutter/cookiecutter-django/pull/4639)) + +- Auto-update pre-commit hooks ([#4641](https://github.com/cookiecutter/cookiecutter-django/pull/4641)) + +## 2023.10.23 + + +### Updated + +- Update pylint-django to 2.5.5 ([#4638](https://github.com/cookiecutter/cookiecutter-django/pull/4638)) + +## 2023.10.19 + + +### Updated + +- Update mypy to 1.6.1 ([#4634](https://github.com/cookiecutter/cookiecutter-django/pull/4634)) + +- Update djangorestframework-stubs to 3.14.4 ([#4637](https://github.com/cookiecutter/cookiecutter-django/pull/4637)) + +- Update django-stubs to 4.2.5 ([#4636](https://github.com/cookiecutter/cookiecutter-django/pull/4636)) + +## 2023.10.17 + + +### Updated + +- Auto-update pre-commit hooks ([#4633](https://github.com/cookiecutter/cookiecutter-django/pull/4633)) + +- Update black to 23.10.0 ([#4632](https://github.com/cookiecutter/cookiecutter-django/pull/4632)) + +- Update pillow to 10.1.0 ([#4630](https://github.com/cookiecutter/cookiecutter-django/pull/4630)) + +- Update django-crispy-forms to 2.1 ([#4629](https://github.com/cookiecutter/cookiecutter-django/pull/4629)) + +## 2023.10.13 + + +### Updated + +- Update pre-commit to 3.5.0 ([#4628](https://github.com/cookiecutter/cookiecutter-django/pull/4628)) + +- Update watchfiles to 0.21.0 ([#4627](https://github.com/cookiecutter/cookiecutter-django/pull/4627)) + +## 2023.10.12 + + +### Updated + +- Update django-cors-headers to 4.3.0 ([#4625](https://github.com/cookiecutter/cookiecutter-django/pull/4625)) + +- Update whitenoise to 6.6.0 ([#4624](https://github.com/cookiecutter/cookiecutter-django/pull/4624)) + +- Update sentry-sdk to 1.32.0 ([#4623](https://github.com/cookiecutter/cookiecutter-django/pull/4623)) + +- Bump traefik from 2.10.4 to 2.10.5 ([#4626](https://github.com/cookiecutter/cookiecutter-django/pull/4626)) + +## 2023.10.09 + + +### Updated + +- Bump stefanzweifel/git-auto-commit-action from 4.16.0 to 5.0.0 ([#4621](https://github.com/cookiecutter/cookiecutter-django/pull/4621)) + +- Update django-storages to 1.14.2 ([#4620](https://github.com/cookiecutter/cookiecutter-django/pull/4620)) + +## 2023.10.08 + + +### Updated + +- Auto-update pre-commit hooks ([#4619](https://github.com/cookiecutter/cookiecutter-django/pull/4619)) + +## 2023.10.05 + + +### Updated + +- Update djangorestframework-stubs to 3.14.3 ([#4618](https://github.com/cookiecutter/cookiecutter-django/pull/4618)) + +- Update django-stubs to 4.2.4 ([#4566](https://github.com/cookiecutter/cookiecutter-django/pull/4566)) + +- Update mypy to 1.5.1 ([#4568](https://github.com/cookiecutter/cookiecutter-django/pull/4568)) + +## 2023.10.04 + + +### Updated + +- Update django to 4.2.6 ([#4617](https://github.com/cookiecutter/cookiecutter-django/pull/4617)) + +- Update coverage to 7.3.2 ([#4616](https://github.com/cookiecutter/cookiecutter-django/pull/4616)) + +- Update werkzeug to 3.0.0 ([#4608](https://github.com/cookiecutter/cookiecutter-django/pull/4608)) + +- Update django-redis to 5.4.0 ([#4609](https://github.com/cookiecutter/cookiecutter-django/pull/4609)) + +- Bump docs Python docker image from 3.11.5 to 3.11.6 ([#4615](https://github.com/cookiecutter/cookiecutter-django/pull/4615)) + +## 2023.10.03 + + +### Changed + +- [pre-commit.ci] pre-commit autoupdate ([#4613](https://github.com/cookiecutter/cookiecutter-django/pull/4613)) + +### Updated + +- Bump prod Python docker image from 3.11.5 to 3.11.6 ([#4611](https://github.com/cookiecutter/cookiecutter-django/pull/4611)) + +- Bump local Python docker image from 3.11.5 to 3.11.6 ([#4612](https://github.com/cookiecutter/cookiecutter-django/pull/4612)) + +- Auto-update pre-commit hooks ([#4610](https://github.com/cookiecutter/cookiecutter-django/pull/4610)) + ## 2023.09.29 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 94ecbdd7d..8d2025e37 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: @@ -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 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 070199124..520f6423d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -194,6 +194,13 @@ Listed in alphabetical order. scaramagus + + aiden + + anyidea + + + Alberto Sanchez @@ -208,6 +215,13 @@ Listed in alphabetical order. + + Alexandr Artemyev + + Mogost + + MOGOST + Alvaro [Andor] @@ -509,6 +523,13 @@ Listed in alphabetical order. + + Christian Jauvin + + cjauvin + + + Christopher Clarke @@ -642,6 +663,13 @@ Listed in alphabetical order. DavidDiazPinto + + David Păcioianu + + DavidPacioianu + + + Davit Tovmasyan @@ -796,6 +824,13 @@ Listed in alphabetical order. fabaff + + farwill + + farwill + + + Fateme Fouladkar @@ -824,6 +859,13 @@ Listed in alphabetical order. + + Freddy + + Hraesvelg + + + Fuzzwah @@ -852,6 +894,13 @@ Listed in alphabetical order. + + Geo Maciolek + + GeoMaciolek + + + ghazi-git @@ -866,6 +915,13 @@ Listed in alphabetical order. + + GitBib + + GitBib + + + Glenn Wiskur @@ -887,6 +943,13 @@ Listed in alphabetical order. + + GvS + + GvS666 + + + Hamish Durkin @@ -936,6 +999,13 @@ Listed in alphabetical order. + + henningbra + + henningbra + + + Henrique G. G. Pereira @@ -1013,6 +1083,13 @@ Listed in alphabetical order. + + JAEGYUN JUNG + + TGoddessana + + + Jakub Boukal @@ -1048,6 +1125,20 @@ Listed in alphabetical order. + + Jason Mok + + jasonmokk + + + + + Jens Kaeske + + jkaeske + + + Jens Nilsson @@ -1321,6 +1412,13 @@ Listed in alphabetical order. flyudvik + + Manas Mallick + + ManDun + + + Manjit Pardeshi @@ -1335,6 +1433,13 @@ Listed in alphabetical order. marciomazza + + Marios Frixou + + frixou89 + + + Martin Blech @@ -1412,6 +1517,13 @@ Listed in alphabetical order. + + Matthew Foster Walsh + + mfosterw + + + Matthew Sisley @@ -1447,13 +1559,6 @@ Listed in alphabetical order. - - mfosterw - - mfosterw - - - Michael Gecht @@ -1468,6 +1573,13 @@ Listed in alphabetical order. + + Michael V. Battista + + mvbattista + + mvbattista + Mike97M @@ -1503,6 +1615,13 @@ Listed in alphabetical order. + + Mounir + + mounirmesselmeni + + + mozillazg @@ -1524,6 +1643,13 @@ Listed in alphabetical order. + + Nadav Peretz + + nadavperetz + + + Naveen @@ -1545,6 +1671,13 @@ Listed in alphabetical order. + + Nix Siow + + nixsiow + + nixsiow + Noah H @@ -1580,6 +1713,13 @@ Listed in alphabetical order. pamelafox + + Param Kapur + + paramkpr + + ParamKapur + Parbhat Puri @@ -1594,6 +1734,20 @@ Listed in alphabetical order. + + Patrick Zhang + + PatDuJour + + + + + Paul Wulff + + mtmpaulwulff + + + Pawan Chaurasia @@ -1643,6 +1797,20 @@ Listed in alphabetical order. + + Plurific + + paulschwenn + + + + + quroom + + quroom + + + Raony Guimarães Corrêa @@ -1762,6 +1930,13 @@ Listed in alphabetical order. shywn_mrk + + Simeon Emanuilov + + s-emanuilov + + s_emanuilov + Simon Rey diff --git a/README.md b/README.md index a9bf1990f..b73ecef9e 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/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 @@ -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) @@ -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! @@ -65,19 +65,15 @@ This project is an open source project run by volunteers. You can sponsor us via Projects that provide financial support to the maintainers: ---- +### Two Scoops of Django -

- -

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

- -

+[![PyUp Logo](https://pyup.io/static/images/logo.png)](https://pyup.io) PyUp brings you automated security and dependency updates used by Google and other organizations. Free for open source projects! @@ -133,12 +129,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 @@ -152,7 +147,7 @@ Answer the prompts with your own desired [options](http://cookiecutter-django.re 4 - Mandrill 5 - Postmark 6 - Sendgrid - 7 - SendinBlue + 7 - Brevo (formerly SendinBlue) 8 - SparkPost 9 - Other SMTP Choose from 1, 2, 3, 4, 5, 6, 7, 8, 9 [1]: 1 diff --git a/cookiecutter.json b/cookiecutter.json index e343617d1..86e44f368 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", @@ -27,7 +27,7 @@ "Mandrill", "Postmark", "Sendgrid", - "SendinBlue", + "Brevo", "SparkPost", "Other SMTP" ], 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 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/deployment-with-docker.rst b/docs/deployment-with-docker.rst index 3d2f9f813..ebc42a52d 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -14,7 +14,7 @@ Prerequisites Understanding the Docker Compose Setup -------------------------------------- -Before you begin, check out the ``production.yml`` file in the root of this project. Keep note of how it provides configuration for the following services: +Before you begin, check out the ``docker-compose.production.yml`` file in the root of this project. Keep note of how it provides configuration for the following services: * ``django``: your application running behind ``Gunicorn``; * ``postgres``: PostgreSQL database with the application's relational data; @@ -107,7 +107,7 @@ To solve this, you can either: 2. create a ``.env`` file in the root of the project with just variables you need. You'll need to also define them in ``.envs/.production/.django`` (hence duplicating them). 3. set these variables when running the build command:: - DJANGO_AWS_S3_CUSTOM_DOMAIN=example.com docker compose -f production.yml build``. + DJANGO_AWS_S3_CUSTOM_DOMAIN=example.com docker compose -f docker-compose.production.yml build``. None of these options are ideal, we're open to suggestions on how to improve this. If you think you have one, please open an issue or a pull request. @@ -122,42 +122,42 @@ Building & Running Production Stack You will need to build the stack first. To do that, run:: - docker compose -f production.yml build + docker compose -f docker-compose.production.yml build Once this is ready, you can run it with:: - docker compose -f production.yml up + docker compose -f docker-compose.production.yml up To run the stack and detach the containers, run:: - docker compose -f production.yml up -d + docker compose -f docker-compose.production.yml up -d To run a migration, open up a second terminal and run:: - docker compose -f production.yml run --rm django python manage.py migrate + docker compose -f docker-compose.production.yml run --rm django python manage.py migrate To create a superuser, run:: - docker compose -f production.yml run --rm django python manage.py createsuperuser + docker compose -f docker-compose.production.yml run --rm django python manage.py createsuperuser If you need a shell, run:: - docker compose -f production.yml run --rm django python manage.py shell + docker compose -f docker-compose.production.yml run --rm django python manage.py shell To check the logs out, run:: - docker compose -f production.yml logs + docker compose -f docker-compose.production.yml logs If you want to scale your application, run:: - docker compose -f production.yml up --scale django=4 - docker compose -f production.yml up --scale celeryworker=2 + docker compose -f docker-compose.production.yml up --scale django=4 + docker compose -f docker-compose.production.yml up --scale celeryworker=2 .. warning:: don't try to scale ``postgres``, ``celerybeat``, or ``traefik``. To see how your containers are doing run:: - docker compose -f production.yml ps + docker compose -f docker-compose.production.yml ps Example: Supervisor @@ -165,12 +165,12 @@ Example: Supervisor Once you are ready with your initial setup, you want to make sure that your application is run by a process manager to survive reboots and auto restarts in case of an error. You can use the process manager you are most familiar with. All -it needs to do is to run ``docker compose -f production.yml up`` in your projects root directory. +it needs to do is to run ``docker compose -f docker-compose.production.yml up`` in your projects root directory. If you are using ``supervisor``, you can use this file as a starting point:: [program:{{cookiecutter.project_slug}}] - command=docker compose -f production.yml up + command=docker compose -f docker-compose.production.yml up directory=/path/to/{{cookiecutter.project_slug}} redirect_stderr=true autostart=true diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index a8f945adf..83de99bb9 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -32,9 +32,9 @@ Build the Stack This can take a while, especially the first time you run this particular command on your development system:: - $ docker compose -f local.yml build + $ docker compose -f docker-compose.local.yml build -Generally, if you want to emulate production environment use ``production.yml`` instead. And this is true for any other actions you might need to perform: whenever a switch is required, just do it! +Generally, if you want to emulate production environment use ``docker-compose.production.yml`` instead. And this is true for any other actions you might need to perform: whenever a switch is required, just do it! Before doing any git commit, `pre-commit`_ should be installed globally on your local machine, and then:: @@ -51,11 +51,11 @@ This brings up both Django and PostgreSQL. The first time it is run it might tak Open a terminal at the project root and run the following for local development:: - $ docker compose -f local.yml up + $ docker compose -f docker-compose.local.yml up -You can also set the environment variable ``COMPOSE_FILE`` pointing to ``local.yml`` like this:: +You can also set the environment variable ``COMPOSE_FILE`` pointing to ``docker-compose.local.yml`` like this:: - $ export COMPOSE_FILE=local.yml + $ export COMPOSE_FILE=docker-compose.local.yml And then run:: @@ -65,16 +65,23 @@ 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 docker-compose.docs.yml up + +To run the docs with local services just use:: + + $ docker compose -f docker-compose.local.yml -f docker-compose.docs.yml up The site should start and be accessible at http://localhost:3000 if you selected Webpack or Gulp as frontend pipeline and http://localhost:8000 otherwise. Execute Management Commands --------------------------- -As with any shell command that we wish to run in our container, this is done using the ``docker compose -f local.yml run --rm`` command: :: +As with any shell command that we wish to run in our container, this is done using the ``docker compose -f docker-compose.local.yml run --rm`` command: :: - $ docker compose -f local.yml run --rm django python manage.py migrate - $ docker compose -f local.yml run --rm django python manage.py createsuperuser + $ docker compose -f docker-compose.local.yml run --rm django python manage.py migrate + $ docker compose -f docker-compose.local.yml run --rm django python manage.py createsuperuser Here, ``django`` is the target service we are executing the commands against. Also, please note that the ``docker exec`` does not work for running management commands. @@ -90,7 +97,7 @@ When ``DEBUG`` is set to ``True``, the host is validated against ``['localhost', Configuring the Environment --------------------------- -This is the excerpt from your project's ``local.yml``: :: +This is the excerpt from your project's ``docker-compose.local.yml``: :: # ... @@ -156,8 +163,8 @@ You have to modify the relevant requirement file: base, local or production by a To get this change picked up, you'll need to rebuild the image(s) and restart the running container: :: - docker compose -f local.yml build - docker compose -f local.yml up + docker compose -f docker-compose.local.yml build + docker compose -f docker-compose.local.yml up Debugging ~~~~~~~~~ @@ -171,7 +178,7 @@ If you are using the following within your code to debug: :: Then you may need to run the following for it to work as desired: :: - $ docker compose -f local.yml run --rm --service-ports django + $ docker compose -f docker-compose.local.yml run --rm --service-ports django django-debug-toolbar @@ -224,7 +231,7 @@ Prerequisites: * ``use_docker`` was set to ``y`` on project initialization; * ``use_celery`` was set to ``y`` on project initialization. -By default, it's enabled both in local and production environments (``local.yml`` and ``production.yml`` Docker Compose configs, respectively) through a ``flower`` service. For added security, ``flower`` requires its clients to provide authentication credentials specified as the corresponding environments' ``.envs/.local/.django`` and ``.envs/.production/.django`` ``CELERY_FLOWER_USER`` and ``CELERY_FLOWER_PASSWORD`` environment variables. Check out ``localhost:5555`` and see for yourself. +By default, it's enabled both in local and production environments (``docker-compose.local.yml`` and ``docker-compose.production.yml`` Docker Compose configs, respectively) through a ``flower`` service. For added security, ``flower`` requires its clients to provide authentication credentials specified as the corresponding environments' ``.envs/.local/.django`` and ``.envs/.production/.django`` ``CELERY_FLOWER_USER`` and ``CELERY_FLOWER_PASSWORD`` environment variables. Check out ``localhost:5555`` and see for yourself. .. _`Flower`: https://github.com/mher/flower @@ -272,7 +279,7 @@ certs Take the certificates that you generated and place them in a folder called ``certs`` in the project's root folder. Assuming that you registered your local hostname as ``my-dev-env.local``, the certificates you will put in the folder should have the names ``my-dev-env.local.crt`` and ``my-dev-env.local.key``. -local.yml +docker-compose.local.yml ~~~~~~~~~ #. Add the ``nginx-proxy`` service. :: @@ -316,7 +323,7 @@ You should allow the new hostname. :: Rebuild your ``docker`` application. :: - $ docker compose -f local.yml up -d --build + $ docker compose -f docker-compose.local.yml up -d --build Go to your browser and type in your URL bar ``https://my-dev-env.local`` @@ -336,9 +343,9 @@ Webpack If you are using Webpack: -1. On the ``nginx-proxy`` service in ``local.yml``, change ``depends_on`` to ``node`` instead of ``django``. +1. On the ``nginx-proxy`` service in ``docker-compose.local.yml``, change ``depends_on`` to ``node`` instead of ``django``. -2. On the ``node`` service in ``local.yml``, add the following environment configuration: +2. On the ``node`` service in ``docker-compose.local.yml``, add the following environment configuration: :: diff --git a/docs/developing-locally.rst b/docs/developing-locally.rst index 92379f4fd..16247d082 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: :: @@ -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 ------------------- diff --git a/docs/docker-postgres-backups.rst b/docs/docker-postgres-backups.rst index c40b6fd69..d214ee4e8 100644 --- a/docs/docker-postgres-backups.rst +++ b/docs/docker-postgres-backups.rst @@ -1,14 +1,14 @@ PostgreSQL Backups with Docker ============================== -.. note:: For brevity it is assumed that you will be running the below commands against local environment, however, this is by no means mandatory so feel free to switch to ``production.yml`` when needed. +.. note:: For brevity it is assumed that you will be running the below commands against local environment, however, this is by no means mandatory so feel free to switch to ``docker-compose.production.yml`` when needed. Prerequisites ------------- #. the project was generated with ``use_docker`` set to ``y``; -#. the stack is up and running: ``docker compose -f local.yml up -d postgres``. +#. the stack is up and running: ``docker compose -f docker-compose.local.yml up -d postgres``. Creating a Backup @@ -16,7 +16,7 @@ Creating a Backup To create a backup, run:: - $ docker compose -f local.yml exec postgres backup + $ docker compose -f docker-compose.local.yml exec postgres backup Assuming your project's database is named ``my_project`` here is what you will see: :: @@ -31,7 +31,7 @@ Viewing the Existing Backups To list existing backups, :: - $ docker compose -f local.yml exec postgres backups + $ docker compose -f docker-compose.local.yml exec postgres backups These are the sample contents of ``/backups``: :: @@ -55,9 +55,9 @@ With a single backup file copied to ``.`` that would be :: $ docker cp 9c5c3f055843:/backups/backup_2018_03_13T09_05_07.sql.gz . -You can also get the container ID using ``docker compose -f local.yml ps -q postgres`` so if you want to automate your backups, you don't have to check the container ID manually every time. Here is the full command :: +You can also get the container ID using ``docker compose -f docker-compose.local.yml ps -q postgres`` so if you want to automate your backups, you don't have to check the container ID manually every time. Here is the full command :: - $ docker cp $(docker compose -f local.yml ps -q postgres):/backups ./backups + $ docker cp $(docker compose -f docker-compose.local.yml ps -q postgres):/backups ./backups .. _`command`: https://docs.docker.com/engine/reference/commandline/cp/ @@ -66,7 +66,7 @@ Restoring from the Existing Backup To restore from one of the backups you have already got (take the ``backup_2018_03_13T09_05_07.sql.gz`` for example), :: - $ docker compose -f local.yml exec postgres restore backup_2018_03_13T09_05_07.sql.gz + $ docker compose -f docker-compose.local.yml exec postgres restore backup_2018_03_13T09_05_07.sql.gz You will see something like :: @@ -92,7 +92,36 @@ You will see something like :: Backup to Amazon S3 ---------------------------------- + For uploading your backups to Amazon S3 you can use the aws cli container. There is an upload command for uploading the postgres /backups directory recursively and there is a download command for downloading a specific backup. The default S3 environment variables are used. :: - $ docker compose -f production.yml run --rm awscli upload - $ docker compose -f production.yml run --rm awscli download backup_2018_03_13T09_05_07.sql.gz + $ docker compose -f docker-compose.production.yml run --rm awscli upload + $ docker compose -f docker-compose.production.yml run --rm awscli download backup_2018_03_13T09_05_07.sql.gz + +Remove Backup +---------------------------------- + +To remove backup you can use the ``rmbackup`` command. This will remove the backup from the ``/backups`` directory. :: + + $ docker compose -f docker-compose.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 docker-compose.local.yml down + $ docker compose -f docker-compose.local.yml up -d postgres + $ docker compose -f docker-compose.local.yml run --rm postgres backup + $ docker compose -f docker-compose.local.yml down + $ docker volume rm my_project_postgres_data + +.. note:: Neglecting to remove the old data volume may lead to issues, such as the new postgres container failing to start with errors like ``FATAL: database files are incompatible with server``, and ``could not translate host name "postgres" to address: Name or service not known``. + +To complete the upgrade, update the PostgreSQL version in the corresponding Dockerfile (e.g. ``compose/production/postgres/Dockerfile``) and build a new version of PostgreSQL. :: + + $ docker compose -f docker-compose.local.yml build postgres + $ docker compose -f docker-compose.local.yml up -d postgres + $ docker compose -f docker-compose.local.yml run --rm postgres restore backup_2018_03_13T09_05_07.sql.gz + $ docker compose -f docker-compose.local.yml up -d diff --git a/docs/document.rst b/docs/document.rst index 26f5d56a1..61cb692d3 100644 --- a/docs/document.rst +++ b/docs/document.rst @@ -11,7 +11,7 @@ After you have set up to `develop locally`_, run the following command from the If you set up your project to `develop locally with docker`_, run the following command: :: - $ docker compose -f local.yml up docs + $ docker compose -f docker-compose.docs.yml up Navigate to port 9000 on your host to see the documentation. This will be opened automatically at `localhost`_ for local, non-docker development. diff --git a/docs/faq.rst b/docs/faq.rst index 52a99467c..294e6c8e1 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/two-scoops-press#two-scoops-of-django 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/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/docs/maintainer-guide.md b/docs/maintainer-guide.md new file mode 100644 index 000000000..9baac688a --- /dev/null +++ b/docs/maintainer-guide.md @@ -0,0 +1,104 @@ +# Maintainer guide + +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. + +### 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 + +- 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 + +`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/docs/project-generation-options.rst b/docs/project-generation-options.rst index 967b42426..21059d3a2 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: @@ -92,7 +91,7 @@ mail_service: 4. Mandrill_ 5. Postmark_ 6. SendGrid_ - 7. SendinBlue_ + 7. `Brevo (formerly SendinBlue)`_ 8. SparkPost_ 9. `Other SMTP`_ @@ -175,7 +174,7 @@ debug: .. _Mandrill: http://mandrill.com .. _Postmark: https://postmarkapp.com .. _SendGrid: https://sendgrid.com -.. _SendinBlue: https://www.sendinblue.com +.. _Brevo (formerly SendinBlue): https://www.brevo.com .. _SparkPost: https://www.sparkpost.com .. _Other SMTP: https://anymail.readthedocs.io/en/stable/ diff --git a/docs/requirements.txt b/docs/requirements.txt index 38a8385fd..26cb8da1b 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,3 @@ -sphinx==7.2.6 -sphinx-rtd-theme==1.3.0 -myst-parser==2.0.0 +sphinx==7.3.7 +sphinx-rtd-theme==2.0.0 +myst-parser==3.0.1 diff --git a/docs/settings.rst b/docs/settings.rst index 0880bce95..2be79cbf5 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -69,8 +69,8 @@ SENDGRID_API_KEY SENDGRID_API_KEY n/a SENDGRID_GENERATE_MESSAGE_ID True n/a raises error SENDGRID_MERGE_FIELD_FORMAT None n/a raises error SENDGRID_API_URL n/a n/a "https://api.sendgrid.com/v3/" -SENDINBLUE_API_KEY SENDINBLUE_API_KEY n/a raises error -SENDINBLUE_API_URL n/a n/a "https://api.sendinblue.com/v3/" +BREVO_API_KEY BREVO_API_KEY n/a raises error +BREVO_API_URL n/a n/a "https://api.brevo.com/v3/" SPARKPOST_API_KEY SPARKPOST_API_KEY n/a raises error SPARKPOST_API_URL n/a n/a "https://api.sparkpost.com/api/v1" ======================================= =========================== ============================================== ====================================================================== diff --git a/docs/testing.rst b/docs/testing.rst index 6387a6e1e..58a05770a 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -19,7 +19,7 @@ You will get a readout of the `users` app that has already been set up with test If you set up your project to `develop locally with docker`_, run the following command: :: - $ docker compose -f local.yml run --rm django pytest + $ docker compose -f docker-compose.local.yml run --rm django pytest Targeting particular apps for testing in ``docker`` follows a similar pattern as previously shown above. @@ -36,14 +36,14 @@ Once the tests are complete, in order to see the code coverage, run the followin If you're running the project locally with Docker, use these commands instead: :: - $ docker compose -f local.yml run --rm django coverage run -m pytest - $ docker compose -f local.yml run --rm django coverage report + $ docker compose -f docker-compose.local.yml run --rm django coverage run -m pytest + $ docker compose -f docker-compose.local.yml run --rm django coverage report .. note:: 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:: diff --git a/docs/troubleshooting.rst b/docs/troubleshooting.rst index 80bab2e29..847f0a701 100644 --- a/docs/troubleshooting.rst +++ b/docs/troubleshooting.rst @@ -30,7 +30,7 @@ If you recreate the project multiple times with the same name, Docker would pres To fix this, you can either: -- Clear your project-related Docker cache with ``docker compose -f local.yml down --volumes --rmi all``. +- Clear your project-related Docker cache with ``docker compose -f docker-compose.local.yml down --volumes --rmi all``. - Use the Docker volume sub-commands to find volumes (`ls`_) and remove them (`rm`_). - Use the `prune`_ command to clear system-wide (use with care!). diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 37f96efc0..9e9af5f2d 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 @@ -77,7 +78,11 @@ def remove_docker_files(): shutil.rmtree(".devcontainer") shutil.rmtree("compose") - file_names = ["local.yml", "production.yml", ".dockerignore"] + file_names = [ + "docker-compose.local.yml", + "docker-compose.production.yml", + ".dockerignore", + ] for file_name in file_names: os.remove(file_name) if "{{ cookiecutter.editor }}" == "PyCharm": @@ -429,10 +434,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 +500,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/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index 33dc2e834..e58fd3541 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 @@ -38,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/requirements.txt b/requirements.txt index 198cf3ab2..cd8a823f8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,28 +1,26 @@ -cookiecutter==2.4.0 -sh==2.0.6; sys_platform != "win32" +cookiecutter==2.6.0 +sh==2.0.7; sys_platform != "win32" binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -black==23.9.1 -isort==5.12.0 -flake8==6.1.0 -django-upgrade==1.15.0 -djlint==1.34.0 -pre-commit==3.4.0 +ruff==0.4.9 +django-upgrade==1.18.0 +djlint==1.34.1 +pre-commit==3.7.1 # Testing # ------------------------------------------------------------------------------ -tox==4.11.3 -pytest==7.4.2 -pytest-xdist==3.3.1 +tox==4.15.1 +pytest==8.2.2 +pytest-xdist==3.6.1 pytest-cookies==0.7.0 pytest-instafail==0.5.0 pyyaml==6.0.1 # Scripting # ------------------------------------------------------------------------------ -PyGithub==2.1.1 -gitpython==3.1.37 -jinja2==3.1.2 -requests==2.31.0 +PyGithub==2.3.0 +gitpython==3.1.43 +jinja2==3.1.4 +requests==2.32.3 diff --git a/scripts/create_django_issue.py b/scripts/create_django_issue.py index 236a126fb..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 @@ -212,7 +213,7 @@ class GitHubManager: for classifier in package_info["info"]["classifiers"]: # Usually in the form of "Framework :: Django :: 3.2" tokens = classifier.split(" ") - if len(tokens) >= 5 and tokens[2].lower() == "django": + if len(tokens) >= 5 and tokens[2].lower() == "django" and "." in tokens[4]: version = DjVersion.parse(tokens[4]) if len(version) == 2: supported_dj_versions.append(version) 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) diff --git a/setup.py b/setup.py index cc4d9a0ab..e240446f8 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2023.09.29" +version = "2024.06.15" with open("README.md") as readme_file: long_description = readme_file.read() @@ -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/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index 31d006bed..5a0bca383 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"}, @@ -74,7 +73,7 @@ SUPPORTED_COMBINATIONS = [ {"cloud_provider": "None", "use_whitenoise": "y", "mail_service": "Mandrill"}, {"cloud_provider": "None", "use_whitenoise": "y", "mail_service": "Postmark"}, {"cloud_provider": "None", "use_whitenoise": "y", "mail_service": "Sendgrid"}, - {"cloud_provider": "None", "use_whitenoise": "y", "mail_service": "SendinBlue"}, + {"cloud_provider": "None", "use_whitenoise": "y", "mail_service": "Brevo"}, {"cloud_provider": "None", "use_whitenoise": "y", "mail_service": "SparkPost"}, {"cloud_provider": "None", "use_whitenoise": "y", "mail_service": "Other SMTP"}, # Note: cloud_provider=None AND use_whitenoise=n is not supported @@ -84,7 +83,7 @@ SUPPORTED_COMBINATIONS = [ {"cloud_provider": "AWS", "mail_service": "Mandrill"}, {"cloud_provider": "AWS", "mail_service": "Postmark"}, {"cloud_provider": "AWS", "mail_service": "Sendgrid"}, - {"cloud_provider": "AWS", "mail_service": "SendinBlue"}, + {"cloud_provider": "AWS", "mail_service": "Brevo"}, {"cloud_provider": "AWS", "mail_service": "SparkPost"}, {"cloud_provider": "AWS", "mail_service": "Other SMTP"}, {"cloud_provider": "GCP", "mail_service": "Mailgun"}, @@ -92,7 +91,7 @@ SUPPORTED_COMBINATIONS = [ {"cloud_provider": "GCP", "mail_service": "Mandrill"}, {"cloud_provider": "GCP", "mail_service": "Postmark"}, {"cloud_provider": "GCP", "mail_service": "Sendgrid"}, - {"cloud_provider": "GCP", "mail_service": "SendinBlue"}, + {"cloud_provider": "GCP", "mail_service": "Brevo"}, {"cloud_provider": "GCP", "mail_service": "SparkPost"}, {"cloud_provider": "GCP", "mail_service": "Other SMTP"}, {"cloud_provider": "Azure", "mail_service": "Mailgun"}, @@ -100,7 +99,7 @@ SUPPORTED_COMBINATIONS = [ {"cloud_provider": "Azure", "mail_service": "Mandrill"}, {"cloud_provider": "Azure", "mail_service": "Postmark"}, {"cloud_provider": "Azure", "mail_service": "Sendgrid"}, - {"cloud_provider": "Azure", "mail_service": "SendinBlue"}, + {"cloud_provider": "Azure", "mail_service": "Brevo"}, {"cloud_provider": "Azure", "mail_service": "SparkPost"}, {"cloud_provider": "Azure", "mail_service": "Other SMTP"}, # Note: cloud_providers GCP, Azure, and None @@ -180,28 +179,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), ) @@ -251,7 +247,13 @@ def test_djlint_lint_passes(cookies, context_override): # TODO: remove T002 when fixed https://github.com/Riverside-Healthcare/djLint/issues/687 ignored_rules = "H006,H030,H031,T002" try: - sh.djlint("--lint", "--ignore", f"{autofixable_rules},{ignored_rules}", ".", _cwd=str(result.project_path)) + sh.djlint( + "--lint", + "--ignore", + f"{autofixable_rules},{ignored_rules}", + ".", + _cwd=str(result.project_path), + ) except sh.ErrorReturnCode as e: pytest.fail(e.stdout.decode()) @@ -272,7 +274,7 @@ def test_djlint_check_passes(cookies, context_override): ["use_docker", "expected_test_script"], [ ("n", "pytest"), - ("y", "docker compose -f local.yml run django pytest"), + ("y", "docker compose -f docker-compose.local.yml run django pytest"), ], ) def test_travis_invokes_pytest(cookies, context, use_docker, expected_test_script): @@ -287,7 +289,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)) @@ -297,7 +299,7 @@ def test_travis_invokes_pytest(cookies, context, use_docker, expected_test_scrip ["use_docker", "expected_test_script"], [ ("n", "pytest"), - ("y", "docker compose -f local.yml run django pytest"), + ("y", "docker compose -f docker-compose.local.yml run django pytest"), ], ) def test_gitlab_invokes_precommit_and_pytest(cookies, context, use_docker, expected_test_script): @@ -324,7 +326,7 @@ def test_gitlab_invokes_precommit_and_pytest(cookies, context, use_docker, expec ["use_docker", "expected_test_script"], [ ("n", "pytest"), - ("y", "docker compose -f local.yml run django pytest"), + ("y", "docker compose -f docker-compose.local.yml run django pytest"), ], ) def test_github_invokes_linter_and_pytest(cookies, context, use_docker, expected_test_script): diff --git a/tests/test_docker.sh b/tests/test_docker.sh index 8e4055e20..473eede04 100755 --- a/tests/test_docker.sh +++ b/tests/test_docker.sh @@ -15,28 +15,38 @@ cookiecutter ../../ --no-input --overwrite-if-exists use_docker=y "$@" cd my_awesome_project # make sure all images build -docker compose -f local.yml build +docker compose -f docker-compose.local.yml build # run the project's type checks -docker compose -f local.yml run django mypy my_awesome_project +docker compose -f docker-compose.local.yml run django mypy my_awesome_project # run the project's tests -docker compose -f local.yml run django pytest +docker compose -f docker-compose.local.yml run django pytest # return non-zero status code if there are migrations that have not been created -docker compose -f local.yml run django python manage.py makemigrations --dry-run --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; } +docker compose -f docker-compose.local.yml run django python manage.py makemigrations --dry-run --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; } # Test support for translations -docker compose -f local.yml run django python manage.py makemessages --all +docker compose -f docker-compose.local.yml run django python manage.py makemessages --all # Make sure the check doesn't raise any warnings -docker compose -f local.yml run django python manage.py check --fail-level WARNING +docker compose -f docker-compose.local.yml run \ + -e DJANGO_SECRET_KEY="$(openssl rand -base64 64)" \ + -e REDIS_URL=redis://redis:6379/0 \ + -e CELERY_BROKER_URL=redis://redis:6379/0 \ + -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 +docker compose -f docker-compose.docs.yml run docs make html # Run npm build script if package.json is present if [ -f "package.json" ] then - docker compose -f local.yml run node npm run build + docker compose -f docker-compose.local.yml run node npm run build fi diff --git a/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/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}}/.devcontainer/devcontainer.json b/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json index 393408582..5604b8a85 100644 --- a/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json +++ b/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ { "name": "{{cookiecutter.project_slug}}_dev", "dockerComposeFile": [ - "../local.yml" + "../docker-compose.local.yml" ], "init": true, "mounts": [ @@ -11,11 +11,6 @@ "target": "/home/dev-user/.bash_history", "type": "bind" }, - { - "source": "/tmp", - "target": "/tmp", - "type": "bind" - }, { "source": "~/.ssh", "target": "/home/dev-user/.ssh", @@ -40,24 +35,13 @@ "analysis.typeCheckingMode": "basic", "defaultInterpreterPath": "/usr/local/bin/python", "editor.codeActionsOnSave": { - "source.organizeImports": true + "source.organizeImports": "always" }, - // 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 @@ -70,8 +54,7 @@ // python "ms-python.python", "ms-python.vscode-pylance", - "ms-python.isort", - "ms-python.black-formatter", + "charliermarsh.ruff", // django "batisteo.vscode-django" ] diff --git a/{{cookiecutter.project_slug}}/.drone.yml b/{{cookiecutter.project_slug}}/.drone.yml index dc08bfbab..d6c13e62b 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: @@ -27,16 +27,17 @@ 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: - - docker-compose -f local.yml build - - docker-compose -f local.yml run --rm django python manage.py migrate - - docker-compose -f local.yml up -d - - docker-compose -f local.yml run django pytest + - docker-compose -f docker-compose.local.yml build + - docker-compose -f docker-compose.docs.yml build + - docker-compose -f docker-compose.local.yml run --rm django python manage.py migrate + - docker-compose -f docker-compose.local.yml up -d + - docker-compose -f docker-compose.local.yml run django pytest {%- else %} - image: python:3.11 + image: python:3.12 commands: - pip install -r requirements/local.txt - pytest diff --git a/{{cookiecutter.project_slug}}/.envs/.production/.django b/{{cookiecutter.project_slug}}/.envs/.production/.django index ad652c9ad..07ffd7112 100644 --- a/{{cookiecutter.project_slug}}/.envs/.production/.django +++ b/{{cookiecutter.project_slug}}/.envs/.production/.django @@ -28,8 +28,8 @@ POSTMARK_SERVER_TOKEN= SENDGRID_API_KEY= SENDGRID_GENERATE_MESSAGE_ID=True SENDGRID_MERGE_FIELD_FORMAT=None -{% elif cookiecutter.mail_service == 'SendinBlue' %} -SENDINBLUE_API_KEY= +{% elif cookiecutter.mail_service == 'Brevo' %} +BREVO_API_KEY= {% elif cookiecutter.mail_service == 'SparkPost' %} SPARKPOST_API_KEY= {% endif %} diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index e39933fe1..5cb9ead4f 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -26,17 +26,17 @@ jobs: uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 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 {%- 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 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,22 +69,25 @@ jobs: {%- if cookiecutter.use_docker == 'y' %} - name: Build the Stack - run: docker compose -f local.yml build + run: docker compose -f docker-compose.local.yml build django + + - name: Build the docs + run: docker compose -f docker-compose.docs.yml build docs - name: Run DB Migrations - run: docker compose -f local.yml run --rm django python manage.py migrate + run: docker compose -f docker-compose.local.yml run --rm django python manage.py migrate - name: Run Django Tests - run: docker compose -f local.yml run django pytest + run: docker compose -f docker-compose.local.yml run django pytest - name: Tear down the Stack - run: docker compose -f local.yml down + run: docker compose -f docker-compose.local.yml down {%- else %} - name: Set up Python 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..41eea0db4 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: @@ -27,20 +27,21 @@ precommit: pytest: stage: test {%- if cookiecutter.use_docker == 'y' %} - image: docker/compose:1.29.2 + image: docker:25.0 tags: - docker services: - docker:dind before_script: - - docker compose -f local.yml build + - docker compose -f docker-compose.local.yml build + - docker compose -f docker-compose.docs.yml build # Ensure celerybeat does not crash due to non-existent tables - - docker compose -f local.yml run --rm django python manage.py migrate - - docker compose -f local.yml up -d + - docker compose -f docker-compose.local.yml run --rm django python manage.py migrate + - docker compose -f docker-compose.local.yml up -d script: - - docker compose -f local.yml run django pytest + - docker compose -f docker-compose.local.yml run django pytest {%- else %} - image: python:3.11 + image: python:3.12 tags: - python services: diff --git a/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_django.xml b/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_django.xml index e84c5ffdd..0eabd93c8 100644 --- a/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_django.xml +++ b/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_django.xml @@ -15,7 +15,7 @@ {%- endif %} -