diff --git a/.github/contributors.json b/.github/contributors.json index 013d2c99d..723c72083 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1478,5 +1478,35 @@ "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" } ] \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7642a3f2d..e6590469a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,7 +9,7 @@ updates: 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 5b46c00c8..9863b5c0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ 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" cache: pip @@ -54,7 +54,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.11" cache: pip @@ -98,7 +98,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.11" cache: pip @@ -110,6 +110,6 @@ jobs: run: pip install -r requirements.txt - 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..e1b36f292 100644 --- a/.github/workflows/django-issue-checker.yml +++ b/.github/workflows/django-issue-checker.yml @@ -17,7 +17,7 @@ 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" - name: Install dependencies diff --git a/.github/workflows/issue-manager.yml b/.github/workflows/issue-manager.yml index a6e074137..e1bb614b1 100644 --- a/.github/workflows/issue-manager.yml +++ b/.github/workflows/issue-manager.yml @@ -23,18 +23,21 @@ jobs: runs-on: ubuntu-latest steps: - - uses: tiangolo/issue-manager@0.4.0 + - uses: tiangolo/issue-manager@0.4.1 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." } } diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml index 67fe9f94a..bfd906cea 100644 --- a/.github/workflows/pre-commit-autoupdate.yml +++ b/.github/workflows/pre-commit-autoupdate.yml @@ -22,7 +22,7 @@ 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" diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index eb037b675..b0150507d 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" - name: Install dependencies diff --git a/.github/workflows/update-contributors.yml b/.github/workflows/update-contributors.yml index d7973b681..0cda836dc 100644 --- a/.github/workflows/update-contributors.yml +++ b/.github/workflows/update-contributors.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" - name: Install dependencies diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c01710499..8c10de974 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,9 @@ exclude: "{{cookiecutter.project_slug}}|.github/contributors.json|CHANGELOG.md|CONTRIBUTORS.md" default_stages: [commit] +default_language_version: + python: python3.11 + repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 @@ -17,7 +20,7 @@ repos: - id: detect-private-key - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v3.1.0" + rev: "v4.0.0-alpha.8" hooks: - id: prettier args: ["--tab-width", "2"] @@ -30,17 +33,17 @@ repos: exclude: hooks/ - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 23.12.1 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/CHANGELOG.md b/CHANGELOG.md index 134149f39..707bef268 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,263 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 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 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 98d8b32f9..9a384d141 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -194,6 +194,13 @@ Listed in alphabetical order. scaramagus + + aiden + + anyidea + + + Alberto Sanchez @@ -831,6 +838,13 @@ Listed in alphabetical order. + + Freddy + + Hraesvelg + + + Fuzzwah @@ -873,6 +887,13 @@ Listed in alphabetical order. + + GitBib + + GitBib + + + Glenn Wiskur @@ -1475,6 +1496,13 @@ Listed in alphabetical order. + + Michael V. Battista + + mvbattista + + mvbattista + Mike97M @@ -1552,6 +1580,13 @@ Listed in alphabetical order. + + Nix Siow + + nixsiow + + nixsiow + Noah H @@ -1650,6 +1685,13 @@ Listed in alphabetical order. + + Plurific + + paulschwenn + + + Raony GuimarĂ£es CorrĂªa diff --git a/docs/requirements.txt b/docs/requirements.txt index 38a8385fd..d002affa7 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,3 @@ sphinx==7.2.6 -sphinx-rtd-theme==1.3.0 +sphinx-rtd-theme==2.0.0 myst-parser==2.0.0 diff --git a/requirements.txt b/requirements.txt index 6c07ccc31..aadf4abb1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,17 +4,17 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -black==23.11.0 -isort==5.12.0 -flake8==6.1.0 +black==23.12.1 +isort==5.13.2 +flake8==7.0.0 django-upgrade==1.15.0 -djlint==1.34.0 -pre-commit==3.5.0 +djlint==1.34.1 +pre-commit==3.6.0 # Testing # ------------------------------------------------------------------------------ -tox==4.11.3 -pytest==7.4.3 +tox==4.12.1 +pytest==7.4.4 pytest-xdist==3.5.0 pytest-cookies==0.7.0 pytest-instafail==0.5.0 @@ -23,6 +23,6 @@ pyyaml==6.0.1 # Scripting # ------------------------------------------------------------------------------ PyGithub==2.1.1 -gitpython==3.1.40 -jinja2==3.1.2 +gitpython==3.1.41 +jinja2==3.1.3 requests==2.31.0 diff --git a/scripts/create_django_issue.py b/scripts/create_django_issue.py index 236a126fb..f9ff76545 100644 --- a/scripts/create_django_issue.py +++ b/scripts/create_django_issue.py @@ -212,7 +212,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/setup.py b/setup.py index 99dc04b2a..8aa7a43bb 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2023.11.22" +version = "2024.01.21" with open("README.md") as readme_file: long_description = readme_file.read() diff --git a/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json b/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json index 393408582..c4158dc10 100644 --- a/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json +++ b/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json @@ -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", diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index fe0c62dfc..902274831 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -1,6 +1,9 @@ -exclude: '^docs/|/migrations/' +exclude: '^docs/|/migrations/|devcontainer.json' default_stages: [commit] +default_language_version: + python: python3.11 + repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 @@ -22,7 +25,7 @@ repos: - id: detect-private-key - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.1.0 + rev: v4.0.0-alpha.8 hooks: - id: prettier args: ['--tab-width', '2', '--single-quote'] @@ -41,22 +44,22 @@ repos: args: [--py311-plus] - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 23.12.1 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 - repo: https://github.com/Riverside-Healthcare/djLint - rev: v1.34.0 + rev: v1.34.1 hooks: - id: djlint-reformat-django files: "templates" diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index deb3f5d61..703474a6f 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -1,5 +1,5 @@ # define an alias for the specific python version used in this file. -FROM python:3.11.6-slim-bullseye as python +FROM python:3.11.7-slim-bookworm as python # Python build stage FROM python as python-build-stage diff --git a/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile index 80a086ab6..41ab15b9f 100644 --- a/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/docs/Dockerfile @@ -1,5 +1,5 @@ # define an alias for the specific python version used in this file. -FROM python:3.11.6-slim-bullseye as python +FROM python:3.11.7-slim-bookworm as python # Python build stage diff --git a/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile index 707ed0c9d..41f42b625 100644 --- a/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18-bullseye-slim +FROM node:20-bookworm-slim WORKDIR /app diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 6ddebbffe..e0da6063c 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -1,5 +1,5 @@ {% if cookiecutter.frontend_pipeline in ['Gulp', 'Webpack'] -%} -FROM node:18-bullseye-slim as client-builder +FROM node:20-bookworm-slim as client-builder ARG APP_HOME=/app WORKDIR ${APP_HOME} @@ -25,7 +25,7 @@ RUN npm run build {%- endif %} # define an alias for the specific python version used in this file. -FROM python:3.11.6-slim-bullseye as python +FROM python:3.11.7-slim-bookworm as python # Python build stage FROM python as python-build-stage diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile index b85b02aa0..321551ead 100644 --- a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile @@ -1,4 +1,4 @@ -FROM traefik:2.10.5 +FROM traefik:2.10.7 RUN mkdir -p /etc/traefik/acme \ && touch /etc/traefik/acme/acme.json \ && chmod 600 /etc/traefik/acme/acme.json diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.yml b/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.yml index 724c95cdf..f5d9e52fc 100644 --- a/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.yml +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.yml @@ -6,7 +6,7 @@ entryPoints: # http address: ':80' http: - # https://docs.traefik.io/routing/entrypoints/#entrypoint + # https://doc.traefik.io/traefik/routing/entrypoints/#entrypoint redirections: entryPoint: to: web-secure @@ -22,11 +22,11 @@ entryPoints: certificatesResolvers: letsencrypt: - # https://docs.traefik.io/master/https/acme/#lets-encrypt + # https://doc.traefik.io/traefik/https/acme/#lets-encrypt acme: email: '{{ cookiecutter.email }}' storage: /etc/traefik/acme/acme.json - # https://docs.traefik.io/master/https/acme/#httpchallenge + # https://doc.traefik.io/traefik/https/acme/#httpchallenge httpChallenge: entryPoint: web @@ -44,7 +44,7 @@ http: - csrf service: django tls: - # https://docs.traefik.io/master/routing/routers/#certresolver + # https://doc.traefik.io/traefik/routing/routers/#certresolver certResolver: letsencrypt {%- if cookiecutter.use_celery == 'y' %} @@ -54,7 +54,7 @@ http: - flower service: flower tls: - # https://docs.traefik.io/master/routing/routers/#certresolver + # https://doc.traefik.io/traefik/master/routing/routers/#certresolver certResolver: letsencrypt {%- endif %} {%- if cookiecutter.cloud_provider == 'None' %} @@ -76,7 +76,7 @@ http: middlewares: csrf: - # https://docs.traefik.io/master/middlewares/headers/#hostsproxyheaders + # https://doc.traefik.io/traefik/master/middlewares/http/headers/#hostsproxyheaders # https://docs.djangoproject.com/en/dev/ref/csrf/#ajax headers: hostsProxyHeaders: ['X-CSRFToken'] @@ -102,7 +102,7 @@ http: {%- endif %} providers: - # https://docs.traefik.io/master/providers/file/ + # https://doc.traefik.io/traefik/master/providers/file/ file: filename: /etc/traefik/traefik.yml watch: true diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 72b4fbe8f..1e77e3f07 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -321,29 +321,29 @@ CELERY_TASK_SEND_SENT_EVENT = True # django-allauth # ------------------------------------------------------------------------------ ACCOUNT_ALLOW_REGISTRATION = env.bool("DJANGO_ACCOUNT_ALLOW_REGISTRATION", True) -# https://django-allauth.readthedocs.io/en/latest/configuration.html +# https://docs.allauth.org/en/latest/account/configuration.html ACCOUNT_AUTHENTICATION_METHOD = "email" -# https://django-allauth.readthedocs.io/en/latest/configuration.html +# https://docs.allauth.org/en/latest/account/configuration.html ACCOUNT_EMAIL_REQUIRED = True -# https://django-allauth.readthedocs.io/en/latest/configuration.html +# https://docs.allauth.org/en/latest/account/configuration.html ACCOUNT_USERNAME_REQUIRED = False -# https://django-allauth.readthedocs.io/en/latest/configuration.html +# https://docs.allauth.org/en/latest/account/configuration.html ACCOUNT_USER_MODEL_USERNAME_FIELD = None -# https://django-allauth.readthedocs.io/en/latest/configuration.html +# https://docs.allauth.org/en/latest/account/configuration.html ACCOUNT_EMAIL_VERIFICATION = "mandatory" -# https://django-allauth.readthedocs.io/en/latest/configuration.html +# https://docs.allauth.org/en/latest/account/configuration.html ACCOUNT_MAX_EMAIL_ADDRESSES = 1 -# https://django-allauth.readthedocs.io/en/latest/configuration.html +# https://docs.allauth.org/en/latest/account/configuration.html ACCOUNT_LOGOUT_ON_GET = True -# https://django-allauth.readthedocs.io/en/latest/configuration.html +# https://docs.allauth.org/en/latest/account/configuration.html SOCIALACCOUNT_LOGIN_ON_GET = True -# https://django-allauth.readthedocs.io/en/latest/configuration.html?highlight=SOCIALACCOUNT_LOGIN_ON_GET +# https://docs.allauth.org/en/latest/account/configuration.html?highlight=SOCIALACCOUNT_LOGIN_ON_GET ACCOUNT_ADAPTER = "{{cookiecutter.project_slug}}.users.adapters.AccountAdapter" -# https://django-allauth.readthedocs.io/en/latest/forms.html +# https://docs.allauth.org/en/latest/account/forms.html ACCOUNT_FORMS = {"signup": "{{cookiecutter.project_slug}}.users.forms.UserSignupForm"} -# https://django-allauth.readthedocs.io/en/latest/configuration.html +# https://docs.allauth.org/en/latest/socialaccount/configuration.html SOCIALACCOUNT_ADAPTER = "{{cookiecutter.project_slug}}.users.adapters.SocialAccountAdapter" -# https://django-allauth.readthedocs.io/en/latest/forms.html +# https://docs.allauth.org/en/latest/socialaccount/configuration.html SOCIALACCOUNT_FORMS = {"signup": "{{cookiecutter.project_slug}}.users.forms.UserSocialSignupForm"} {% if cookiecutter.frontend_pipeline == 'Django Compressor' -%} # django-compressor diff --git a/{{cookiecutter.project_slug}}/local.yml b/{{cookiecutter.project_slug}}/local.yml index 692d87499..6609f8053 100644 --- a/{{cookiecutter.project_slug}}/local.yml +++ b/{{cookiecutter.project_slug}}/local.yml @@ -58,7 +58,7 @@ services: {%- if cookiecutter.use_mailpit == 'y' %} mailpit: - image: axllent/mailpit:v1.8 + image: axllent/mailpit:latest container_name: {{ cookiecutter.project_slug }}_local_mailpit ports: - "8025:8025" diff --git a/{{cookiecutter.project_slug}}/package.json b/{{cookiecutter.project_slug}}/package.json index 99b984da6..958b15ded 100644 --- a/{{cookiecutter.project_slug}}/package.json +++ b/{{cookiecutter.project_slug}}/package.json @@ -8,7 +8,7 @@ "autoprefixer": "^10.4.0", "babel-loader": "^9.1.2", "bootstrap": "^5.2.3", - "browser-sync": "^2.27.7", + "browser-sync": "^3.0.2", "css-loader": "^6.5.1", "gulp-concat": "^2.6.1", "concurrently": "^8.0.1", @@ -24,18 +24,18 @@ "node-sass-tilde-importer": "^1.0.2", "pixrem": "^5.0.0", "postcss": "^8.3.11", - "postcss-loader": "^7.0.2", + "postcss-loader": "^8.0.0", "postcss-preset-env": "^9.0.0", "sass": "^1.43.4", - "sass-loader": "^13.2.0", + "sass-loader": "^14.0.0", "webpack": "^5.65.0", - "webpack-bundle-tracker": "^2.0.0", + "webpack-bundle-tracker": "^3.0.1", "webpack-cli": "^5.0.1", "webpack-dev-server": "^4.6.0", "webpack-merge": "^5.8.0" }, "engines": { - "node": "18" + "node": "20" }, "browserslist": [ "last 2 versions" diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 01d671fcd..1bfa53eb2 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,5 +1,5 @@ python-slugify==8.0.1 # https://github.com/un33k/python-slugify -Pillow==10.1.0 # https://github.com/python-pillow/Pillow +Pillow==10.2.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} {%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} rcssmin==1.1.0 --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin @@ -13,7 +13,7 @@ whitenoise==6.6.0 # https://github.com/evansd/whitenoise {%- endif %} redis==5.0.1 # https://github.com/redis/redis-py {%- if cookiecutter.use_docker == "y" or cookiecutter.windows == "n" %} -hiredis==2.2.3 # https://github.com/redis/hiredis-py +hiredis==2.3.2 # https://github.com/redis/hiredis-py {%- endif %} {%- if cookiecutter.use_celery == "y" %} celery==5.3.6 # pyup: < 6.0 # https://github.com/celery/celery @@ -23,15 +23,15 @@ flower==2.0.1 # https://github.com/mher/flower {%- endif %} {%- endif %} {%- if cookiecutter.use_async == 'y' %} -uvicorn[standard]==0.24.0.post1 # https://github.com/encode/uvicorn +uvicorn[standard]==0.26.0 # https://github.com/encode/uvicorn {%- endif %} # Django # ------------------------------------------------------------------------------ -django==4.2.7 # pyup: < 5.0 # https://www.djangoproject.com/ +django==4.2.9 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.11.2 # https://github.com/joke2k/django-environ django-model-utils==4.3.1 # https://github.com/jazzband/django-model-utils -django-allauth==0.58.2 # https://github.com/pennersr/django-allauth +django-allauth==0.60.1 # https://github.com/pennersr/django-allauth django-crispy-forms==2.1 # https://github.com/django-crispy-forms/django-crispy-forms crispy-bootstrap5==2023.10 # https://github.com/django-crispy-forms/crispy-bootstrap5 {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} @@ -43,13 +43,13 @@ django-redis==5.4.0 # https://github.com/jazzband/django-redis djangorestframework==3.14.0 # https://github.com/encode/django-rest-framework django-cors-headers==4.3.1 # https://github.com/adamchainz/django-cors-headers # DRF-spectacular for api documentation -drf-spectacular==0.26.5 # https://github.com/tfranzel/drf-spectacular +drf-spectacular==0.27.1 # https://github.com/tfranzel/drf-spectacular {%- endif %} {%- if cookiecutter.frontend_pipeline == 'Webpack' %} -django-webpack-loader==2.0.1 # https://github.com/django-webpack/django-webpack-loader +django-webpack-loader==3.0.1 # https://github.com/django-webpack/django-webpack-loader {%- endif %} # Project # ------------------------------------------------------------------------------ -fontawesomefree==6.4.2 # https://github.com/FortAwesome/Font-Awesome -django-import-export==3.3.3 # https://github.com/django-import-export/django-import-export +fontawesomefree==6.5.1 # https://github.com/FortAwesome/Font-Awesome +django-import-export==3.3.6 # https://github.com/django-import-export/django-import-export diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 49c277549..6cb9d4434 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -3,9 +3,9 @@ Werkzeug[watchdog]==3.0.1 # https://github.com/pallets/werkzeug ipdb==0.13.13 # https://github.com/gotcha/ipdb {%- if cookiecutter.use_docker == 'y' %} -psycopg[c]==3.1.13 # https://github.com/psycopg/psycopg +psycopg[c]==3.1.17 # https://github.com/psycopg/psycopg {%- else %} -psycopg[binary]==3.1.13 # https://github.com/psycopg/psycopg +psycopg[binary]==3.1.17 # https://github.com/psycopg/psycopg {%- endif %} {%- if cookiecutter.use_async == 'y' or cookiecutter.use_celery == 'y' %} watchfiles==0.21.0 # https://github.com/samuelcolvin/watchfiles @@ -13,12 +13,12 @@ watchfiles==0.21.0 # https://github.com/samuelcolvin/watchfiles # Testing # ------------------------------------------------------------------------------ -mypy==1.6.1 # https://github.com/python/mypy -django-stubs[compatible-mypy]==4.2.6 # https://github.com/typeddjango/django-stubs -pytest==7.4.3 # https://github.com/pytest-dev/pytest +mypy==1.7.1 # https://github.com/python/mypy +django-stubs[compatible-mypy]==4.2.7 # https://github.com/typeddjango/django-stubs +pytest==7.4.4 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.7 # https://github.com/Frozenball/pytest-sugar {%- if cookiecutter.use_drf == "y" %} -djangorestframework-stubs[compatible-mypy]==3.14.4 # https://github.com/typeddjango/djangorestframework-stubs +djangorestframework-stubs[compatible-mypy]==3.14.5 # https://github.com/typeddjango/djangorestframework-stubs {%- endif %} # Documentation @@ -29,16 +29,16 @@ sphinx-rtd-theme==1.3.0 # https://pypi.org/project/sphinx-rtd-theme/ # Code quality # ------------------------------------------------------------------------------ -flake8==6.1.0 # https://github.com/PyCQA/flake8 +flake8==7.0.0 # https://github.com/PyCQA/flake8 flake8-isort==6.1.1 # https://github.com/gforcada/flake8-isort -coverage==7.3.2 # https://github.com/nedbat/coveragepy -black==23.11.0 # https://github.com/psf/black -djlint==1.34.0 # https://github.com/Riverside-Healthcare/djLint +coverage==7.4.0 # https://github.com/nedbat/coveragepy +black==23.12.1 # https://github.com/psf/black +djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pylint-django==2.5.5 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} -pre-commit==3.5.0 # https://github.com/pre-commit/pre-commit +pre-commit==3.6.0 # https://github.com/pre-commit/pre-commit # Django # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index d762f3596..80afd9e18 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -3,15 +3,15 @@ -r base.txt gunicorn==21.2.0 # https://github.com/benoitc/gunicorn -psycopg[c]==3.1.13 # https://github.com/psycopg/psycopg +psycopg[c]==3.1.17 # https://github.com/psycopg/psycopg {%- if cookiecutter.use_whitenoise == 'n' %} Collectfast==2.2.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==1.37.0 # https://github.com/getsentry/sentry-python +sentry-sdk==1.39.2 # https://github.com/getsentry/sentry-python {%- endif %} {%- if cookiecutter.use_docker == "n" and cookiecutter.windows == "y" %} -hiredis==2.2.3 # https://github.com/redis/hiredis-py +hiredis==2.3.2 # https://github.com/redis/hiredis-py {%- endif %} # Django diff --git a/{{cookiecutter.project_slug}}/runtime.txt b/{{cookiecutter.project_slug}}/runtime.txt index 76b6e496e..1f79d441f 100644 --- a/{{cookiecutter.project_slug}}/runtime.txt +++ b/{{cookiecutter.project_slug}}/runtime.txt @@ -1 +1 @@ -python-3.11.6 +python-3.11.7 diff --git a/{{cookiecutter.project_slug}}/utility/requirements-bookworm.apt b/{{cookiecutter.project_slug}}/utility/requirements-bookworm.apt new file mode 100644 index 000000000..a4910eb6d --- /dev/null +++ b/{{cookiecutter.project_slug}}/utility/requirements-bookworm.apt @@ -0,0 +1,23 @@ +##basic build dependencies of various Django apps for Debian Bookworm 12.x +#build-essential metapackage install: make, gcc, g++, +build-essential +#required to translate +gettext +python3-dev + +##shared dependencies of: +##Pillow, pylibmc +zlib1g-dev + +##Postgresql and psycopg2 dependencies +libpq-dev + +##Pillow dependencies +libtiff5-dev +libjpeg62-turbo-dev +libfreetype6-dev +liblcms2-dev +libwebp-dev + +##django-extensions +libgraphviz-dev diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py index dde90fd09..43e7683ea 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py @@ -10,7 +10,7 @@ User = get_user_model() if settings.DJANGO_ADMIN_FORCE_ALLAUTH: # Force the `admin` sign in process to go through the `django-allauth` workflow: - # https://django-allauth.readthedocs.io/en/stable/advanced.html#admin + # https://docs.allauth.org/en/latest/common/admin.html#admin admin.site.login = decorators.login_required(admin.site.login) # type: ignore[method-assign] diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/__init__.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py index 37d00516e..c1a234116 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py @@ -1,4 +1,10 @@ +from importlib import reload + +import pytest +from django.contrib import admin +from django.contrib.auth.models import AnonymousUser from django.urls import reverse +from pytest_django.asserts import assertRedirects from {{ cookiecutter.project_slug }}.users.models import User @@ -37,3 +43,25 @@ class TestUserAdmin: url = reverse("admin:users_user_change", kwargs={"object_id": user.pk}) response = admin_client.get(url) assert response.status_code == 200 + + @pytest.fixture + def force_allauth(self, settings): + settings.DJANGO_ADMIN_FORCE_ALLAUTH = True + # Reload the admin module to apply the setting change + import {{ cookiecutter.project_slug }}.users.admin as users_admin # pylint: disable=import-outside-toplevel + + try: + reload(users_admin) + except admin.sites.AlreadyRegistered: + pass + + @pytest.mark.django_db + @pytest.mark.usefixtures("force_allauth") + def test_allauth_login(self, rf, settings): + request = rf.get("/fake-url") + request.user = AnonymousUser() + response = admin.site.login(request) + + # The `admin` login view should redirect to the `allauth` login view + target_url = reverse(settings.LOGIN_URL) + "?next=" + request.path + assertRedirects(response, target_url, fetch_redirect_response=False)