From 357604f37b0137e49e08e0e043c75cbf4457c366 Mon Sep 17 00:00:00 2001 From: Mounir Date: Fri, 23 Feb 2024 15:35:52 +0100 Subject: [PATCH 1/5] Install ruff extension in devcontainer.json (#4887) organizeImports is expecting a string. --- .../.devcontainer/devcontainer.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json b/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json index 7fcd62872c..e16d06a202 100644 --- a/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json +++ b/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json @@ -35,7 +35,7 @@ "analysis.typeCheckingMode": "basic", "defaultInterpreterPath": "/usr/local/bin/python", "editor.codeActionsOnSave": { - "source.organizeImports": true + "source.organizeImports": "always" }, "editor.defaultFormatter": "charliermarsh.ruff", "languageServer": "Pylance", @@ -54,8 +54,7 @@ // python "ms-python.python", "ms-python.vscode-pylance", - "ms-python.isort", - "ms-python.black-formatter", + "charliermarsh.ruff", // django "batisteo.vscode-django" ] From 916f6666372bf5b1a61e2abe2b24f4e62294d5d3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 23 Feb 2024 14:36:31 +0000 Subject: [PATCH 2/5] Update Contributors --- .github/contributors.json | 5 +++++ CONTRIBUTORS.md | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/.github/contributors.json b/.github/contributors.json index 057309a52a..785ee4b35b 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1523,5 +1523,10 @@ "name": "Paul Wulff", "github_login": "mtmpaulwulff", "twitter_username": "" + }, + { + "name": "Mounir", + "github_login": "mounirmesselmeni", + "twitter_username": "" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 734900362f..30064acb8a 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1552,6 +1552,13 @@ Listed in alphabetical order. + + Mounir + + mounirmesselmeni + + + mozillazg From 4db3ea1e581be7d5792ea77326aa7cfb42d0548c Mon Sep 17 00:00:00 2001 From: Matthew Foster Walsh <15671892+mfosterw@users.noreply.github.com> Date: Fri, 23 Feb 2024 09:37:34 -0500 Subject: [PATCH 3/5] Switch to local imports within app (#4883) --- .../{{cookiecutter.project_slug}}/users/admin.py | 6 +++--- .../{{cookiecutter.project_slug}}/users/forms.py | 2 +- .../{{cookiecutter.project_slug}}/users/managers.py | 2 +- .../{{cookiecutter.project_slug}}/users/models.py | 2 +- .../{{cookiecutter.project_slug}}/users/tasks.py | 2 +- .../{{cookiecutter.project_slug}}/users/urls.py | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py index d0d1488f86..70f8292565 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py @@ -4,9 +4,9 @@ from django.contrib.auth.decorators import login_required from django.utils.translation import gettext_lazy as _ -from {{ cookiecutter.project_slug }}.users.forms import UserAdminChangeForm -from {{ cookiecutter.project_slug }}.users.forms import UserAdminCreationForm -from {{ cookiecutter.project_slug }}.users.models import User +from .forms import UserAdminChangeForm +from .forms import UserAdminCreationForm +from .models import User if settings.DJANGO_ADMIN_FORCE_ALLAUTH: # Force the `admin` sign in process to go through the `django-allauth` workflow: diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py index 2d18de2089..830fca60df 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py @@ -6,7 +6,7 @@ {%- endif %} from django.utils.translation import gettext_lazy as _ -from {{ cookiecutter.project_slug }}.users.models import User +from .models import User class UserAdminChangeForm(admin_forms.UserChangeForm): diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py index c75c0e9705..d8beaa48e1 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py @@ -4,7 +4,7 @@ from django.contrib.auth.models import UserManager as DjangoUserManager if TYPE_CHECKING: - from {{ cookiecutter.project_slug }}.users.models import User # noqa: F401 + from .models import User # noqa: F401 class UserManager(DjangoUserManager["User"]): diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py index fd78c26a80..4a870cc285 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py @@ -11,7 +11,7 @@ from django.utils.translation import gettext_lazy as _ {%- if cookiecutter.username_type == "email" %} -from {{ cookiecutter.project_slug }}.users.managers import UserManager +from .managers import UserManager {%- endif %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py index 2afd4d4bde..ca51cd7401 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py @@ -1,6 +1,6 @@ from celery import shared_task -from {{ cookiecutter.project_slug }}.users.models import User +from .models import User @shared_task() diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py index 40719ed21d..74d65da1e2 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py @@ -1,8 +1,8 @@ from django.urls import path -from {{ cookiecutter.project_slug }}.users.views import user_detail_view -from {{ cookiecutter.project_slug }}.users.views import user_redirect_view -from {{ cookiecutter.project_slug }}.users.views import user_update_view +from .views import user_detail_view +from .views import user_redirect_view +from .views import user_update_view app_name = "users" urlpatterns = [ From 0ca9be321ad3e3d67c65efcfad1521cab32f274a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 14:38:40 +0000 Subject: [PATCH 4/5] Bump webpack-dev-server to 5.0.2 (#4875) * Bump webpack-dev-server in /{{cookiecutter.project_slug}} Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 4.15.1 to 5.0.2. - [Release notes](https://github.com/webpack/webpack-dev-server/releases) - [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack/webpack-dev-server/compare/v4.15.1...v5.0.2) --- updated-dependencies: - dependency-name: webpack-dev-server dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Update server proxy syntax for webpack-dev-server@v5 --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bruno Alla --- {{cookiecutter.project_slug}}/package.json | 2 +- .../webpack/dev.config.js | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/{{cookiecutter.project_slug}}/package.json b/{{cookiecutter.project_slug}}/package.json index efa2136e55..9ca7282087 100644 --- a/{{cookiecutter.project_slug}}/package.json +++ b/{{cookiecutter.project_slug}}/package.json @@ -31,7 +31,7 @@ "webpack": "^5.65.0", "webpack-bundle-tracker": "^3.0.1", "webpack-cli": "^5.0.1", - "webpack-dev-server": "^4.6.0", + "webpack-dev-server": "^5.0.2", "webpack-merge": "^5.8.0" }, "engines": { diff --git a/{{cookiecutter.project_slug}}/webpack/dev.config.js b/{{cookiecutter.project_slug}}/webpack/dev.config.js index 8276c34890..7c774185ea 100644 --- a/{{cookiecutter.project_slug}}/webpack/dev.config.js +++ b/{{cookiecutter.project_slug}}/webpack/dev.config.js @@ -6,13 +6,16 @@ module.exports = merge(commonConfig, { devtool: 'inline-source-map', devServer: { port: 3000, - proxy: { - {%- if cookiecutter.use_docker == 'n' %} - '/': 'http://0.0.0.0:8000', - {%- else %} - '/': 'http://django:8000', - {%- endif %} - }, + proxy: [ + { + context: ['/'], + {%- if cookiecutter.use_docker == 'n' %} + target: 'http://0.0.0.0:8000', + {%- else %} + target: 'http://django:8000', + {%- endif %} + }, + ], client: { overlay: { errors: true, From 37f974157bc5a8b59585c99c62de35e03b9e0358 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 23 Feb 2024 15:43:30 +0100 Subject: [PATCH 5/5] Switch to dependabot for template & docs deps updates This enables us to use a separate label --- .github/dependabot.yml | 16 ++++++++++++++++ .pyup.yml | 2 -- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e6590469af..3582a21253 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,6 +3,22 @@ version: 2 updates: + # Update Python deps for the template (not the generated project) + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + labels: + - "project infrastructure" + + # Update Python deps for the documentation + - package-ecosystem: "pip" + directory: "docs/" + schedule: + interval: "daily" + labels: + - "project infrastructure" + # Update GitHub actions in workflows - package-ecosystem: "github-actions" directory: "/" diff --git a/.pyup.yml b/.pyup.yml index e5d4752e44..13d336d57f 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"