From 4caad4a1297a555343e12a6e887b0cfe9b6e370d Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 24 Feb 2021 02:25:29 +0000 Subject: [PATCH 01/51] Update Changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5838e06e..d0a4c8f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## [2021-02-23] +### Changed +- Update to Django 3.1 ([#3043](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3043)) +- Lint with pre-commit on CI with Github actions ([#3066](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3066)) +- Use exception var in status code pages if available ([#2992](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/2992)) + ## [2021-02-22] ### Changed - refactor: remove default cache settings in test.py ([#3064](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3064)) From d396264efaad39fcb17409f7b56db4c3d1947e6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Feb 2021 07:19:28 +0000 Subject: [PATCH 02/51] Bump stefanzweifel/git-auto-commit-action from v4.9.0 to v4.9.1 Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from v4.9.0 to v4.9.1. - [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases) - [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.9.0...296e083b4c312cf3438feb21957a85fa9677f61d) Signed-off-by: dependabot[bot] --- .github/workflows/update-changelog.yml | 2 +- .github/workflows/update-contributors.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index 7cb2a1b8..5c63532b 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -28,7 +28,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4.9.0 + uses: stefanzweifel/git-auto-commit-action@v4.9.1 with: commit_message: Update Changelog file_pattern: CHANGELOG.md diff --git a/.github/workflows/update-contributors.yml b/.github/workflows/update-contributors.yml index 4d9026b9..64a899e4 100644 --- a/.github/workflows/update-contributors.yml +++ b/.github/workflows/update-contributors.yml @@ -24,7 +24,7 @@ jobs: run: python scripts/update_contributors.py - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4.9.0 + uses: stefanzweifel/git-auto-commit-action@v4.9.1 with: commit_message: Update Contributors file_pattern: CONTRIBUTORS.md .github/contributors.json From e0566e5b1eeb9c8e17ff66b9fd9a0529bcdf768c Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 25 Feb 2021 02:23:46 +0000 Subject: [PATCH 03/51] Update Changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0a4c8f2..f3ca4775 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## [2021-02-24] +### Updated +- Bump stefanzweifel/git-auto-commit-action from v4.9.0 to v4.9.1 ([#3069](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3069)) + ## [2021-02-23] ### Changed - Update to Django 3.1 ([#3043](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3043)) From fa0b278225b8b444cf2d40c85d3939d3806e5c75 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Fri, 26 Feb 2021 12:04:48 +0530 Subject: [PATCH 04/51] Updated test_urls and views to re-use User.get_absolute_url method instead of using reverse on the user:detail view --- .../{{cookiecutter.project_slug}}/users/tests/test_urls.py | 5 +---- .../{{cookiecutter.project_slug}}/users/views.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py index aab6d0a8..2623f4e3 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py @@ -7,10 +7,7 @@ pytestmark = pytest.mark.django_db def test_detail(user: User): - assert ( - reverse("users:detail", kwargs={"username": user.username}) - == f"/users/{user.username}/" - ) + assert user.get_absolute_url() == f"/users/{user.username}/" assert resolve(f"/users/{user.username}/").view_name == "users:detail" diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py index 2b077d42..c7b846c0 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py @@ -25,7 +25,7 @@ class UserUpdateView(LoginRequiredMixin, SuccessMessageMixin, UpdateView): success_message = _("Information successfully updated") def get_success_url(self): - return reverse("users:detail", kwargs={"username": self.request.user.username}) + return self.request.user.get_absolute_url() # type: ignore [union-attr] def get_object(self): return self.request.user From 691229b979ef9695658f3c29f236d181ac97c32c Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 1 Mar 2021 12:00:56 -0800 Subject: [PATCH 05/51] Update coverage from 5.4 to 5.5 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 6960b1d7..47bba136 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -27,7 +27,7 @@ sphinx-autobuild==2020.9.1 # https://github.com/GaretJax/sphinx-autobuild # ------------------------------------------------------------------------------ flake8==3.8.4 # https://github.com/PyCQA/flake8 flake8-isort==4.0.0 # https://github.com/gforcada/flake8-isort -coverage==5.4 # https://github.com/nedbat/coveragepy +coverage==5.5 # https://github.com/nedbat/coveragepy black==20.8b1 # https://github.com/ambv/black pylint-django==2.4.2 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} From 51b92b935f25976847a198b1018f24000583e53e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 1 Mar 2021 21:07:12 -0800 Subject: [PATCH 06/51] Update pillow from 8.1.0 to 8.1.1 --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 71317e81..d5382a6d 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,6 +1,6 @@ pytz==2021.1 # https://github.com/stub42/pytz python-slugify==4.0.1 # https://github.com/un33k/python-slugify -Pillow==8.1.0 # https://github.com/python-pillow/Pillow +Pillow==8.1.1 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} {%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} rcssmin==1.0.6 --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin From 97935112664cb5c267f3099a395f004ff8c7e873 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Mar 2021 19:48:26 +0000 Subject: [PATCH 07/51] Support both master and main branches --- {{cookiecutter.project_slug}}/.github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index 378ee30b..c8bda217 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -7,11 +7,11 @@ env: on: pull_request: - branches: [ "master" ] + branches: [ "master", "main" ] paths-ignore: [ "docs/**" ] push: - branches: [ "master" ] + branches: [ "master", "main" ] paths-ignore: [ "docs/**" ] From c1ec7e3cd1fe6d4fc578430cf013b098611d5557 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Mar 2021 20:03:14 +0000 Subject: [PATCH 08/51] Add necessary services for GH actions without Docker --- .../.github/workflows/ci.yml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index c8bda217..c84d3eeb 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -37,6 +37,30 @@ jobs: # With no caching at all the entire ci process takes 4m 30s to complete! pytest: runs-on: ubuntu-latest + {%- if cookiecutter.use_docker == 'n' %} + + services: + {%- if cookiecutter.use_celery == 'y' %} + redis: + image: redis:5.0 + ports: + - 6379:6379 + {%- endif %} + postgres: + image: postgres:12 + ports: + - 5432:5432 + env: + POSTGRES_PASSWORD: postgres + + env: + {%- if cookiecutter.use_celery == 'y' %} + CELERY_BROKER_URL: "redis://localhost:6379/0" + {%- endif %} + # postgres://user:password@host:port/database + DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres" + {%- endif %} + steps: - name: Checkout Code Repository From c3ee08fbb2be2688af155e3eb36a14be438f5d3d Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Mar 2021 20:03:27 +0000 Subject: [PATCH 09/51] Tweak formatting of workflow file --- {{cookiecutter.project_slug}}/.github/workflows/ci.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index c84d3eeb..7799cf41 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: - name: Install and Run Pre-commit uses: pre-commit/action@v2.0.0 -# With no caching at all the entire ci process takes 4m 30s to complete! + # With no caching at all the entire ci process takes 4m 30s to complete! pytest: runs-on: ubuntu-latest {%- if cookiecutter.use_docker == 'n' %} @@ -65,7 +65,7 @@ jobs: - name: Checkout Code Repository uses: actions/checkout@v2 - {% if cookiecutter.use_docker == 'y' -%} + {%- if cookiecutter.use_docker == 'y' %} - name: Build the Stack run: docker-compose -f local.yml build @@ -81,7 +81,6 @@ jobs: - name: Tear down the Stack run: docker-compose -f local.yml down - {%- else %} - name: Set up Python 3.8 @@ -93,8 +92,8 @@ jobs: id: pip-cache-location run: | echo "::set-output name=dir::$(pip cache dir)" + {%- raw %} - {% raw %} - name: Cache pip Project Dependencies uses: actions/cache@v2 with: @@ -104,7 +103,7 @@ jobs: key: ${{ runner.os }}-pip-${{ hashFiles('**/local.txt') }} restore-keys: | ${{ runner.os }}-pip- - {% endraw %} + {%- endraw %} - name: Install Dependencies run: | @@ -113,5 +112,4 @@ jobs: - name: Test with pytest run: pytest - {%- endif %} From d999846ca27693dfa0efb0813e477a03f968d704 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Mar 2021 20:11:15 +0000 Subject: [PATCH 10/51] Fix Github CI with Docker --- {{cookiecutter.project_slug}}/.github/workflows/ci.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index 7799cf41..9798e6c8 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -70,14 +70,11 @@ jobs: - name: Build the Stack run: docker-compose -f local.yml build - - name: Make DB Migrations + - name: Run DB Migrations run: docker-compose -f local.yml run --rm django python manage.py migrate - - name: Run the Stack - run: docker-compose -f local.yml up -d - - name: Run Django Tests - run: docker-compose -f local.yml exec -T django pytest + run: docker-compose -f local.yml run django pytest - name: Tear down the Stack run: docker-compose -f local.yml down From a6e45554500fa7b2c2883710d1085833d635bb9d Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Mar 2021 21:20:20 +0000 Subject: [PATCH 11/51] Update tests --- tests/test_cookiecutter_generation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index c8514493..7e585ea4 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -231,7 +231,7 @@ def test_gitlab_invokes_flake8_and_pytest( ["use_docker", "expected_test_script"], [ ("n", "pytest"), - ("y", "docker-compose -f local.yml exec -T django pytest"), + ("y", "docker-compose -f local.yml run django pytest"), ], ) def test_github_invokes_linter_and_pytest( From d47052388fa8cfdb7cd17410334a32c274ad3dbc Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 2 Mar 2021 17:00:27 -0800 Subject: [PATCH 12/51] Update ipdb from 0.13.4 to 0.13.5 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 47bba136..ec239bb4 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,7 +1,7 @@ -r base.txt Werkzeug==1.0.1 # https://github.com/pallets/werkzeug -ipdb==0.13.4 # https://github.com/gotcha/ipdb +ipdb==0.13.5 # https://github.com/gotcha/ipdb {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8.6 # https://github.com/psycopg/psycopg2 {%- else %} From a87d131a2a0bf771b75b6b8a9859d9011fce0ec7 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 3 Mar 2021 02:27:47 +0000 Subject: [PATCH 13/51] Update Changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3ca4775..0b2a0877 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## [2021-03-02] +### Fixed +- Fixes for pytest job in Github CI workflow ([#3076](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3076)) +### Updated +- Update pillow to 8.1.1 ([#3075](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3075)) +- Update coverage to 5.5 ([#3074](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3074)) + ## [2021-02-24] ### Updated - Bump stefanzweifel/git-auto-commit-action from v4.9.0 to v4.9.1 ([#3069](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3069)) From 15b7b97722647b4500e0db7995f46b43d7ec987f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 3 Mar 2021 11:54:07 -0800 Subject: [PATCH 14/51] Update tox from 3.22.0 to 3.23.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index cce198bf..a410f313 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8-isort==4.0.0 # Testing # ------------------------------------------------------------------------------ -tox==3.22.0 +tox==3.23.0 pytest==5.4.3 # pyup: <6 # https://github.com/hackebrot/pytest-cookies/issues/51 pytest-cookies==0.5.1 pytest-instafail==0.4.2 From 899faa766b23cf307b359d8d65cf6aed73a68d83 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 4 Mar 2021 02:28:43 +0000 Subject: [PATCH 15/51] Update Changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b2a0877..1a0e1b74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## [2021-03-03] +### Updated +- Update tox to 3.23.0 ([#3079](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3079)) +- Update ipdb to 0.13.5 ([#3078](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3078)) + ## [2021-03-02] ### Fixed - Fixes for pytest job in Github CI workflow ([#3076](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3076)) From 1371d6a3e60efa097b3464a784e8587219c64509 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Thu, 4 Mar 2021 19:34:58 +0530 Subject: [PATCH 16/51] Reverting the use of get_absolute_url method in getting the detail view url. Purpose was to test if the url could be created correctly and not if the view was working correctly. --- .../{{cookiecutter.project_slug}}/users/tests/test_urls.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py index 2623f4e3..aab6d0a8 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py @@ -7,7 +7,10 @@ pytestmark = pytest.mark.django_db def test_detail(user: User): - assert user.get_absolute_url() == f"/users/{user.username}/" + assert ( + reverse("users:detail", kwargs={"username": user.username}) + == f"/users/{user.username}/" + ) assert resolve(f"/users/{user.username}/").view_name == "users:detail" From b593c9884470274f38c6f17d7be33a87cd3cb577 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Mar 2021 05:53:28 +0000 Subject: [PATCH 17/51] Bump stefanzweifel/git-auto-commit-action from v4.9.1 to v4.9.2 Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from v4.9.1 to v4.9.2. - [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases) - [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.9.1...be7095c202abcf573b09f20541e0ee2f6a3a9d9b) Signed-off-by: dependabot[bot] --- .github/workflows/update-changelog.yml | 2 +- .github/workflows/update-contributors.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index 5c63532b..fa70824c 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -28,7 +28,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4.9.1 + uses: stefanzweifel/git-auto-commit-action@v4.9.2 with: commit_message: Update Changelog file_pattern: CHANGELOG.md diff --git a/.github/workflows/update-contributors.yml b/.github/workflows/update-contributors.yml index 64a899e4..5d5dd0ea 100644 --- a/.github/workflows/update-contributors.yml +++ b/.github/workflows/update-contributors.yml @@ -24,7 +24,7 @@ jobs: run: python scripts/update_contributors.py - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4.9.1 + uses: stefanzweifel/git-auto-commit-action@v4.9.2 with: commit_message: Update Contributors file_pattern: CONTRIBUTORS.md .github/contributors.json From 3d67dc267193986b88df05b163738e2dabd0ec75 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 6 Mar 2021 02:29:15 +0000 Subject: [PATCH 18/51] Update Changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a0e1b74..150dd390 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## [2021-03-05] +### Changed +- Updated test_urls.py and views.py to re-use User.get_absolute_url() ([#3070](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3070)) +### Updated +- Bump stefanzweifel/git-auto-commit-action from v4.9.1 to v4.9.2 ([#3082](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3082)) + ## [2021-03-03] ### Updated - Update tox to 3.23.0 ([#3079](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3079)) From fb6cb0f51eedb1e801dc57be71363af8102a0b0d Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 6 Mar 2021 23:08:35 -0800 Subject: [PATCH 19/51] Update pillow from 8.1.1 to 8.1.2 --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index d5382a6d..377f2d05 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,6 +1,6 @@ pytz==2021.1 # https://github.com/stub42/pytz python-slugify==4.0.1 # https://github.com/un33k/python-slugify -Pillow==8.1.1 # https://github.com/python-pillow/Pillow +Pillow==8.1.2 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} {%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} rcssmin==1.0.6 --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin From 569ab9af4a204ca71e407b6ca45a9d8887036350 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 10 Mar 2021 08:50:25 -0800 Subject: [PATCH 20/51] Update pre-commit from 2.10.1 to 2.11.1 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index ec239bb4..ed3479fc 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -33,7 +33,7 @@ pylint-django==2.4.2 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} -pre-commit==2.10.1 # https://github.com/pre-commit/pre-commit +pre-commit==2.11.1 # https://github.com/pre-commit/pre-commit # Django # ------------------------------------------------------------------------------ From 078ae92e01ae9d6c59762e94664e66527e222593 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 15 Mar 2021 14:27:21 -0700 Subject: [PATCH 21/51] Update flake8 from 3.8.4 to 3.9.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a410f313..54dbc229 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ binaryornot==0.4.4 # ------------------------------------------------------------------------------ black==20.8b1 isort==5.7.0 -flake8==3.8.4 +flake8==3.9.0 flake8-isort==4.0.0 # Testing From b6c6d682ff649414fed8258bafb0d84159724666 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 15 Mar 2021 14:27:22 -0700 Subject: [PATCH 22/51] Update flake8 from 3.8.4 to 3.9.0 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index ec239bb4..9b49a0b4 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -25,7 +25,7 @@ sphinx-autobuild==2020.9.1 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ -flake8==3.8.4 # https://github.com/PyCQA/flake8 +flake8==3.9.0 # https://github.com/PyCQA/flake8 flake8-isort==4.0.0 # https://github.com/gforcada/flake8-isort coverage==5.5 # https://github.com/nedbat/coveragepy black==20.8b1 # https://github.com/ambv/black From d36f7e8617e9e107eb97cd14a8ef3f7bd2256df6 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 22 Mar 2021 00:27:06 +0000 Subject: [PATCH 23/51] Auto-update pre-commit hooks --- {{cookiecutter.project_slug}}/.pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 5a5b58a6..fd4572f7 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -16,12 +16,12 @@ repos: - id: black - repo: https://github.com/timothycrosley/isort - rev: 5.7.0 + rev: 5.8.0 hooks: - id: isort - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.4 + rev: 3.9.0 hooks: - id: flake8 args: ['--config=setup.cfg'] From b9eaa50ff565a33d65c56b8848ce7c4cc588fa11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20C=2E=20Barrionuevo=20da=20Luz?= Date: Sun, 21 Mar 2021 22:48:36 -0300 Subject: [PATCH 24/51] Add non-python requirements file for Ubuntu 20.04 --- .../utility/requirements-focal.apt | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 {{cookiecutter.project_slug}}/utility/requirements-focal.apt diff --git a/{{cookiecutter.project_slug}}/utility/requirements-focal.apt b/{{cookiecutter.project_slug}}/utility/requirements-focal.apt new file mode 100644 index 00000000..fe6f21e4 --- /dev/null +++ b/{{cookiecutter.project_slug}}/utility/requirements-focal.apt @@ -0,0 +1,23 @@ +##basic build dependencies of various Django apps for Ubuntu Focal 20.04 +#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 +libjpeg8-dev +libfreetype6-dev +liblcms2-dev +libwebp-dev + +##django-extensions +graphviz-dev From 2ea090a0de268cddccd3defcb6ade4f77bfa1ca7 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 22 Mar 2021 03:47:05 -0700 Subject: [PATCH 25/51] Update isort from 5.7.0 to 5.8.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 54dbc229..3b16db8d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ black==20.8b1 -isort==5.7.0 +isort==5.8.0 flake8==3.9.0 flake8-isort==4.0.0 From 779270832223d243d5f416c48547090c4e776cc5 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 22 Mar 2021 03:51:35 -0700 Subject: [PATCH 26/51] Update sphinx-autobuild from 2020.9.1 to 2021.3.14 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 49640cb2..a1e39ca5 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -21,7 +21,7 @@ pytest-sugar==0.9.4 # https://github.com/Frozenball/pytest-sugar # Documentation # ------------------------------------------------------------------------------ sphinx==3.5.1 # https://github.com/sphinx-doc/sphinx -sphinx-autobuild==2020.9.1 # https://github.com/GaretJax/sphinx-autobuild +sphinx-autobuild==2021.3.14 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ From be4e70bbd907565b4cc9c59ea6c114ca7109f1f1 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 22 Mar 2021 03:52:19 -0700 Subject: [PATCH 27/51] Update ipdb from 0.13.5 to 0.13.7 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 49640cb2..6fafe86d 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,7 +1,7 @@ -r base.txt Werkzeug==1.0.1 # https://github.com/pallets/werkzeug -ipdb==0.13.5 # https://github.com/gotcha/ipdb +ipdb==0.13.7 # https://github.com/gotcha/ipdb {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8.6 # https://github.com/psycopg/psycopg2 {%- else %} From 34877810799668e1b6e1ab75f5c8e5abef618602 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 22 Mar 2021 04:18:19 -0700 Subject: [PATCH 28/51] Update sphinx from 3.5.1 to 3.5.3 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 9b853557..b6a7e543 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -20,7 +20,7 @@ pytest-sugar==0.9.4 # https://github.com/Frozenball/pytest-sugar # Documentation # ------------------------------------------------------------------------------ -sphinx==3.5.1 # https://github.com/sphinx-doc/sphinx +sphinx==3.5.3 # https://github.com/sphinx-doc/sphinx sphinx-autobuild==2021.3.14 # https://github.com/GaretJax/sphinx-autobuild # Code quality From b07c5d5d906beac2b435b8560bd8595e4649e9f9 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 22 Mar 2021 07:21:59 -0700 Subject: [PATCH 29/51] Update django-crispy-forms from 1.11.1 to 1.11.2 --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 377f2d05..75479fdb 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -33,7 +33,7 @@ django==3.1.7 # pyup: < 3.2 # https://www.djangoproject.com/ django-environ==0.4.5 # https://github.com/joke2k/django-environ django-model-utils==4.1.1 # https://github.com/jazzband/django-model-utils django-allauth==0.44.0 # https://github.com/pennersr/django-allauth -django-crispy-forms==1.11.1 # https://github.com/django-crispy-forms/django-crispy-forms +django-crispy-forms==1.11.2 # https://github.com/django-crispy-forms/django-crispy-forms {%- if cookiecutter.use_compressor == "y" %} django-compressor==2.4 # https://github.com/django-compressor/django-compressor {%- endif %} From b6bd76d4287b2bcb35bbd8a1c85ba05140edc5bd Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 23 Mar 2021 02:37:18 +0000 Subject: [PATCH 30/51] Update Changelog --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 150dd390..db8f052f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,18 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## [2021-03-22] +### Updated +- Update django-crispy-forms to 1.11.2 ([#3104](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3104)) +- Update sphinx to 3.5.3 ([#3103](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3103)) +- Update ipdb to 0.13.7 ([#3102](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3102)) +- Update sphinx-autobuild to 2021.3.14 ([#3101](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3101)) +- Update isort to 5.8.0 ([#3100](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3100)) +- Update pre-commit to 2.11.1 ([#3089](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3089)) +- Update flake8 to 3.9.0 ([#3096](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3096)) +- Update pillow to 8.1.2 ([#3084](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3084)) +- Auto-update pre-commit hooks ([#3095](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3095)) + ## [2021-03-05] ### Changed - Updated test_urls.py and views.py to re-use User.get_absolute_url() ([#3070](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3070)) From a7847ec2ccc2ff58eb8335658770833fa38a335e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 25 Mar 2021 09:30:30 -0700 Subject: [PATCH 31/51] Update djangorestframework from 3.12.2 to 3.12.3 --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 75479fdb..69b11ce7 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -40,6 +40,6 @@ django-compressor==2.4 # https://github.com/django-compressor/django-compressor django-redis==4.12.1 # https://github.com/jazzband/django-redis {%- if cookiecutter.use_drf == "y" %} # Django REST Framework -djangorestframework==3.12.2 # https://github.com/encode/django-rest-framework +djangorestframework==3.12.3 # https://github.com/encode/django-rest-framework django-cors-headers==3.7.0 # https://github.com/adamchainz/django-cors-headers {%- endif %} From ebc2f0446ac1cd22f5817f8bb63b0bda1d22ea51 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 26 Mar 2021 02:15:58 +0000 Subject: [PATCH 32/51] Update Changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db8f052f..15c176db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## [2021-03-25] +### Updated +- Update djangorestframework to 3.12.3 ([#3105](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3105)) + ## [2021-03-22] ### Updated - Update django-crispy-forms to 1.11.2 ([#3104](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3104)) From 140c3a961caa6862c57112f7d068161bbed24e58 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 26 Mar 2021 09:30:46 -0700 Subject: [PATCH 33/51] Update djangorestframework from 3.12.3 to 3.12.4 --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 69b11ce7..1946b075 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -40,6 +40,6 @@ django-compressor==2.4 # https://github.com/django-compressor/django-compressor django-redis==4.12.1 # https://github.com/jazzband/django-redis {%- if cookiecutter.use_drf == "y" %} # Django REST Framework -djangorestframework==3.12.3 # https://github.com/encode/django-rest-framework +djangorestframework==3.12.4 # https://github.com/encode/django-rest-framework django-cors-headers==3.7.0 # https://github.com/adamchainz/django-cors-headers {%- endif %} From a18ccd35238745c588281b1436807c65ccd3c5d6 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 27 Mar 2021 02:23:07 +0000 Subject: [PATCH 34/51] Update Changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15c176db..d1479a28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## [2021-03-26] +### Updated +- Update djangorestframework to 3.12.4 ([#3107](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3107)) + ## [2021-03-25] ### Updated - Update djangorestframework to 3.12.3 ([#3105](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3105)) From 0073683c7056ef69686c6f7c3f8f251a23731909 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 27 Mar 2021 02:04:38 -0700 Subject: [PATCH 35/51] Update gunicorn from 20.0.4 to 20.1.0 --- {{cookiecutter.project_slug}}/requirements/production.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 0ce6fc10..743cb3f9 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -2,7 +2,7 @@ -r base.txt -gunicorn==20.0.4 # https://github.com/benoitc/gunicorn +gunicorn==20.1.0 # https://github.com/benoitc/gunicorn psycopg2==2.8.6 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} Collectfast==2.2.0 # https://github.com/antonagestam/collectfast From 5314faaf8adaf2fcd5cd3b369bca2fc8ebdbc51a Mon Sep 17 00:00:00 2001 From: Tames McTigue Date: Tue, 30 Mar 2021 13:09:29 +0300 Subject: [PATCH 36/51] Fixed placement of image key value for non-Docker run. --- {{cookiecutter.project_slug}}/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/.gitlab-ci.yml b/{{cookiecutter.project_slug}}/.gitlab-ci.yml index 60925b81..fcdfb7dd 100644 --- a/{{cookiecutter.project_slug}}/.gitlab-ci.yml +++ b/{{cookiecutter.project_slug}}/.gitlab-ci.yml @@ -21,7 +21,6 @@ flake8: pytest: stage: test - image: python:3.8 {% if cookiecutter.use_docker == 'y' -%} image: docker/compose:latest tags: @@ -36,6 +35,7 @@ pytest: script: - docker-compose -f local.yml run django pytest {%- else %} + image: python:3.8 tags: - python services: From 49bf68aa006986e427665400f9fd99b09b34fda1 Mon Sep 17 00:00:00 2001 From: Tames McTigue Date: Tue, 30 Mar 2021 13:26:12 +0300 Subject: [PATCH 37/51] Fixed blank space --- {{cookiecutter.project_slug}}/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/.gitlab-ci.yml b/{{cookiecutter.project_slug}}/.gitlab-ci.yml index fcdfb7dd..c599f6b6 100644 --- a/{{cookiecutter.project_slug}}/.gitlab-ci.yml +++ b/{{cookiecutter.project_slug}}/.gitlab-ci.yml @@ -34,7 +34,7 @@ pytest: - docker-compose -f local.yml up -d script: - docker-compose -f local.yml run django pytest - {%- else %} + {%- else -%} image: python:3.8 tags: - python From 0ef98a118b110fff72caf5b8dbac4efd97330a3b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 2 Apr 2021 11:19:19 -0700 Subject: [PATCH 38/51] Update pillow from 8.1.2 to 8.2.0 --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 1946b075..96619498 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,6 +1,6 @@ pytz==2021.1 # https://github.com/stub42/pytz python-slugify==4.0.1 # https://github.com/un33k/python-slugify -Pillow==8.1.2 # https://github.com/python-pillow/Pillow +Pillow==8.2.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} {%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} rcssmin==1.0.6 --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin From 9e62ff99d5d1c4b035eea44b6d2d053c31d26061 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 4 Apr 2021 12:36:50 -0700 Subject: [PATCH 39/51] Update pytest from 6.2.2 to 6.2.3 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index b6a7e543..fdce88d7 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -15,7 +15,7 @@ watchgod==0.6 # https://github.com/samuelcolvin/watchgod # ------------------------------------------------------------------------------ mypy==0.812 # https://github.com/python/mypy django-stubs==1.7.0 # https://github.com/typeddjango/django-stubs -pytest==6.2.2 # https://github.com/pytest-dev/pytest +pytest==6.2.3 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.4 # https://github.com/Frozenball/pytest-sugar # Documentation From a5727efc5555974ada6aac02d6ec9887140b8678 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 5 Apr 2021 08:36:26 -0700 Subject: [PATCH 40/51] Update django-extensions from 3.1.1 to 3.1.2 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index b6a7e543..fbe62a58 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -40,6 +40,6 @@ pre-commit==2.11.1 # https://github.com/pre-commit/pre-commit factory-boy==3.2.0 # https://github.com/FactoryBoy/factory_boy django-debug-toolbar==3.2 # https://github.com/jazzband/django-debug-toolbar -django-extensions==3.1.1 # https://github.com/django-extensions/django-extensions +django-extensions==3.1.2 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.8.0 # https://github.com/nedbat/django_coverage_plugin pytest-django==4.1.0 # https://github.com/pytest-dev/pytest-django From 289a14aef102c4e93e311a679cfb778a8f05c0f1 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 6 Apr 2021 17:56:14 -0700 Subject: [PATCH 41/51] Update django from 3.1.7 to 3.1.8 --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 1946b075..25d1802d 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -29,7 +29,7 @@ uvicorn[standard]==0.13.4 # https://github.com/encode/uvicorn # Django # ------------------------------------------------------------------------------ -django==3.1.7 # pyup: < 3.2 # https://www.djangoproject.com/ +django==3.1.8 # pyup: < 3.2 # https://www.djangoproject.com/ django-environ==0.4.5 # https://github.com/joke2k/django-environ django-model-utils==4.1.1 # https://github.com/jazzband/django-model-utils django-allauth==0.44.0 # https://github.com/pennersr/django-allauth From a567c85fb5018125b2bb06bd3d5d86d53a2b1ebe Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 6 Apr 2021 21:03:28 -0700 Subject: [PATCH 42/51] Update pre-commit from 2.11.1 to 2.12.0 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index b6a7e543..dcbd76b9 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -33,7 +33,7 @@ pylint-django==2.4.2 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} -pre-commit==2.11.1 # https://github.com/pre-commit/pre-commit +pre-commit==2.12.0 # https://github.com/pre-commit/pre-commit # Django # ------------------------------------------------------------------------------ From 3a23b5f45e385aeaac2e754989648ccb7403d58c Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 4 Mar 2021 07:47:26 -0800 Subject: [PATCH 43/51] Update sentry-sdk from 0.20.3 to 1.0.0 --- {{cookiecutter.project_slug}}/requirements/production.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 743cb3f9..6e566ecc 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.6 # https://github.com/psycopg/psycopg2 Collectfast==2.2.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.20.3 # https://github.com/getsentry/sentry-python +sentry-sdk==1.0.0 # https://github.com/getsentry/sentry-python {%- endif %} {%- if cookiecutter.use_docker == "n" and cookiecutter.windows == "y" %} hiredis==1.1.0 # https://github.com/redis/hiredis-py From fa143aa60a2711fd36c7624f21278aa726c35697 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 7 Apr 2021 20:47:03 +0100 Subject: [PATCH 44/51] Bump version to 3.1.8 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index bc31d84a..f8cfe29c 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ except ImportError: # Our version ALWAYS matches the version of Django we support # If Django has a new release, we branch, tag, then update this setting after the tag. -version = "3.1.7" +version = "3.1.8" if sys.argv[-1] == "tag": os.system(f'git tag -a {version} -m "version {version}"') From 3f3148f88fdd015acf61cd731eaa944ab260a3cc Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 7 Apr 2021 19:50:12 +0000 Subject: [PATCH 45/51] 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 5b5c575c..84637568 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1077,5 +1077,10 @@ "name": "lcd1232", "github_login": "lcd1232", "twitter_username": "" + }, + { + "name": "Tames McTigue", + "github_login": "Tamerz", + "twitter_username": "" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9a8e3019..ea870187 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1363,6 +1363,13 @@ Listed in alphabetical order. + + Tames McTigue + + Tamerz + + + Tano Abeleyra From 095a2a56af953d2d1fd8f3c78e2585e8300b90cd Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Mar 2021 21:50:57 +0000 Subject: [PATCH 46/51] Run linting via pre-commit on CI --- tests/test_bare.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_bare.sh b/tests/test_bare.sh index eae09dc7..c7938ecf 100755 --- a/tests/test_bare.sh +++ b/tests/test_bare.sh @@ -27,5 +27,10 @@ sudo utility/install_os_dependencies.sh install # Install Python deps pip install -r requirements/local.txt +# Lint by running pre-commit on all files +git init +git add . +pre-commit run --show-diff-on-failure -a + # run the project's tests pytest From c38289493410d2401a5903f6feada0d3f3d79fe3 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Mar 2021 22:50:28 +0000 Subject: [PATCH 47/51] Fix pre-commit hook issues --- .../.pre-commit-config.yaml | 1 - {{cookiecutter.project_slug}}/.pylintrc | 2 +- {{cookiecutter.project_slug}}/LICENSE | 8 ++-- {{cookiecutter.project_slug}}/Procfile | 4 +- {{cookiecutter.project_slug}}/README.rst | 41 ++++++++++--------- .../compose/production/traefik/traefik.yml | 2 +- .../config/settings/base.py | 5 ++- .../config/settings/production.py | 3 +- {{cookiecutter.project_slug}}/local.yml | 5 +-- {{cookiecutter.project_slug}}/production.yml | 3 +- .../utility/install_python_dependencies.sh | 3 +- .../templates/403.html | 3 +- .../templates/404.html | 3 +- .../templates/500.html | 3 +- .../templates/account/account_inactive.html | 2 +- .../templates/account/base.html | 2 +- .../templates/account/email.html | 2 +- .../templates/account/email_confirm.html | 2 +- .../templates/account/login.html | 2 +- .../templates/account/logout.html | 4 +- .../templates/account/password_change.html | 2 +- .../templates/account/password_reset.html | 2 +- .../account/password_reset_done.html | 6 +-- .../account/password_reset_from_key.html | 2 +- .../account/password_reset_from_key_done.html | 2 +- .../templates/account/password_set.html | 2 +- .../templates/account/signup.html | 2 +- .../templates/account/signup_closed.html | 2 +- .../templates/account/verification_sent.html | 2 +- .../account/verified_email_required.html | 4 +- .../templates/base.html | 24 +++++------ .../templates/pages/about.html | 2 +- .../templates/pages/home.html | 2 +- .../templates/users/user_detail.html | 3 +- .../templates/users/user_form.html | 3 +- 35 files changed, 78 insertions(+), 82 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index fd4572f7..df71ea61 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -26,4 +26,3 @@ repos: - id: flake8 args: ['--config=setup.cfg'] additional_dependencies: [flake8-isort] - diff --git a/{{cookiecutter.project_slug}}/.pylintrc b/{{cookiecutter.project_slug}}/.pylintrc index a0955f07..dff52e75 100644 --- a/{{cookiecutter.project_slug}}/.pylintrc +++ b/{{cookiecutter.project_slug}}/.pylintrc @@ -1,5 +1,5 @@ [MASTER] -load-plugins=pylint_django{% if cookiecutter.use_celery == "y" %}, pylint_celery {% endif %} +load-plugins=pylint_django{% if cookiecutter.use_celery == "y" %}, pylint_celery{% endif %} [FORMAT] max-line-length=120 diff --git a/{{cookiecutter.project_slug}}/LICENSE b/{{cookiecutter.project_slug}}/LICENSE index c831e030..812fa0fa 100644 --- a/{{cookiecutter.project_slug}}/LICENSE +++ b/{{cookiecutter.project_slug}}/LICENSE @@ -7,7 +7,7 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -{% elif cookiecutter.open_source_license == 'BSD' %} +{%- elif cookiecutter.open_source_license == 'BSD' %} Copyright (c) {% now 'utc', '%Y' %}, {{ cookiecutter.author_name }} All rights reserved. @@ -35,7 +35,7 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -{% elif cookiecutter.open_source_license == 'GPLv3' %} +{%- elif cookiecutter.open_source_license == 'GPLv3' %} Copyright (c) {% now 'utc', '%Y' %}, {{ cookiecutter.author_name }} This program is free software: you can redistribute it and/or modify @@ -50,7 +50,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . -{% elif cookiecutter.open_source_license == 'Apache Software License 2.0' %} +{%- elif cookiecutter.open_source_license == 'Apache Software License 2.0' %} Apache License Version 2.0, January 2004 @@ -242,4 +242,4 @@ along with this program. If not, see . WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -{% endif %} +{%- endif %} diff --git a/{{cookiecutter.project_slug}}/Procfile b/{{cookiecutter.project_slug}}/Procfile index 0becb2cb..8679a066 100644 --- a/{{cookiecutter.project_slug}}/Procfile +++ b/{{cookiecutter.project_slug}}/Procfile @@ -1,10 +1,10 @@ release: python manage.py migrate -{% if cookiecutter.use_async == "y" -%} +{%- if cookiecutter.use_async == "y" -%} web: gunicorn config.asgi:application -k uvicorn.workers.UvicornWorker {%- else %} web: gunicorn config.wsgi:application {%- endif %} -{% if cookiecutter.use_celery == "y" -%} +{%- if cookiecutter.use_celery == "y" -%} worker: celery worker --app=config.celery_app --loglevel=info beat: celery beat --app=config.celery_app --loglevel=info {%- endif %} diff --git a/{{cookiecutter.project_slug}}/README.rst b/{{cookiecutter.project_slug}}/README.rst index 2aae422c..b120f16a 100644 --- a/{{cookiecutter.project_slug}}/README.rst +++ b/{{cookiecutter.project_slug}}/README.rst @@ -9,10 +9,10 @@ .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/ambv/black :alt: Black code style -{% if cookiecutter.open_source_license != "Not open source" %} +{%- if cookiecutter.open_source_license != "Not open source" %} :License: {{cookiecutter.open_source_license}} -{% endif %} +{%- endif %} Settings -------- @@ -67,7 +67,7 @@ Moved to `Live reloading and SASS compilation`_. .. _`Live reloading and SASS compilation`: http://cookiecutter-django.readthedocs.io/en/latest/live-reloading-and-sass-compilation.html -{% if cookiecutter.use_celery == "y" %} +{%- if cookiecutter.use_celery == "y" %} Celery ^^^^^^ @@ -83,19 +83,21 @@ To run a celery worker: Please note: For Celery's import magic to work, it is important *where* the celery commands are run. If you are in the same folder with *manage.py*, you should be right. -{% endif %} -{% if cookiecutter.use_mailhog == "y" %} +{%- endif %} +{%- if cookiecutter.use_mailhog == "y" %} Email Server ^^^^^^^^^^^^ -{% if cookiecutter.use_docker == 'y' %} +{%- if cookiecutter.use_docker == 'y' %} + In development, it is often nice to be able to see emails that are being sent from your application. For that reason local SMTP server `MailHog`_ with a web interface is available as docker container. Container mailhog will start automatically when you will run all docker containers. Please check `cookiecutter-django Docker documentation`_ for more details how to start all containers. With MailHog running, to view messages that are sent by your application, open your browser and go to ``http://127.0.0.1:8025`` -{% else %} +{%- else %} + In development, it is often nice to be able to see emails that are being sent from your application. If you choose to use `MailHog`_ when generating the project a local SMTP server with a web interface will be available. #. `Download the latest MailHog release`_ for your OS. @@ -117,10 +119,10 @@ In development, it is often nice to be able to see emails that are being sent fr Now you have your own mail server running locally, ready to receive whatever you send it. .. _`Download the latest MailHog release`: https://github.com/mailhog/MailHog/releases -{% endif %} +{%- endif %} .. _mailhog: https://github.com/mailhog/MailHog -{% endif %} -{% if cookiecutter.use_sentry == "y" %} +{%- endif %} +{%- if cookiecutter.use_sentry == "y" %} Sentry ^^^^^^ @@ -129,13 +131,13 @@ Sentry is an error logging aggregator service. You can sign up for a free accoun The system is setup with reasonable defaults, including 404 logging and integration with the WSGI application. You must set the DSN url in production. -{% endif %} +{%- endif %} Deployment ---------- The following details how to deploy this application. -{% if cookiecutter.use_heroku.lower() == "y" %} +{%- if cookiecutter.use_heroku.lower() == "y" %} Heroku ^^^^^^ @@ -143,8 +145,8 @@ Heroku See detailed `cookiecutter-django Heroku documentation`_. .. _`cookiecutter-django Heroku documentation`: http://cookiecutter-django.readthedocs.io/en/latest/deployment-on-heroku.html -{% endif %} -{% if cookiecutter.use_docker.lower() == "y" %} +{%- endif %} +{%- if cookiecutter.use_docker.lower() == "y" %} Docker ^^^^^^ @@ -152,9 +154,8 @@ Docker See detailed `cookiecutter-django Docker documentation`_. .. _`cookiecutter-django Docker documentation`: http://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html -{% endif %} - -{% if cookiecutter.custom_bootstrap_compilation == "y" %} +{%- endif %} +{%- if cookiecutter.custom_bootstrap_compilation == "y" %} Custom Bootstrap Compilation ^^^^^^ @@ -163,11 +164,11 @@ Bootstrap v4 is installed using npm and customised by tweaking your variables in You can find a list of available variables `in the bootstrap source`_, or get explanations on them in the `Bootstrap docs`_. -{% if cookiecutter.js_task_runner == 'Gulp' %} +{%- if cookiecutter.js_task_runner == 'Gulp' %} Bootstrap's javascript as well as its dependencies is concatenated into a single file: ``static/js/vendors.js``. -{% endif %} +{%- endif %} .. _in the bootstrap source: https://github.com/twbs/bootstrap/blob/v4-dev/scss/_variables.scss .. _Bootstrap docs: https://getbootstrap.com/docs/4.1/getting-started/theming/ -{% endif %} +{%- endif %} diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.yml b/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.yml index 7b56063f..cc183cd6 100644 --- a/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.yml +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.yml @@ -35,7 +35,7 @@ http: web-secure-router: {%- if cookiecutter.domain_name.count('.') == 1 %} rule: "Host(`{{ cookiecutter.domain_name }}`) || Host(`www.{{ cookiecutter.domain_name }}`)" - {% else %} + {%- else %} rule: "Host(`{{ cookiecutter.domain_name }}`)" {%- endif %} entryPoints: diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index f69908c2..640d8b62 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -44,7 +44,7 @@ LOCALE_PATHS = [str(ROOT_DIR / "locale")] DATABASES = {"default": env.db("DATABASE_URL")} {%- else %} DATABASES = { - "default": env.db("DATABASE_URL", default="postgres://{% if cookiecutter.windows == 'y' %}localhost{% endif %}/{{cookiecutter.project_slug}}") + "default": env.db("DATABASE_URL", default="postgres://{% if cookiecutter.windows == 'y' %}localhost{% endif %}/{{cookiecutter.project_slug}}"), } {%- endif %} DATABASES["default"]["ATOMIC_REQUESTS"] = True @@ -230,7 +230,8 @@ X_FRAME_OPTIONS = "DENY" # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#email-backend EMAIL_BACKEND = env( - "DJANGO_EMAIL_BACKEND", default="django.core.mail.backends.smtp.EmailBackend" + "DJANGO_EMAIL_BACKEND", + default="django.core.mail.backends.smtp.EmailBackend", ) # https://docs.djangoproject.com/en/dev/ref/settings/#email-timeout EMAIL_TIMEOUT = 5 diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index bd0acfbd..59928f82 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -146,7 +146,8 @@ DEFAULT_FROM_EMAIL = env( SERVER_EMAIL = env("DJANGO_SERVER_EMAIL", default=DEFAULT_FROM_EMAIL) # https://docs.djangoproject.com/en/dev/ref/settings/#email-subject-prefix EMAIL_SUBJECT_PREFIX = env( - "DJANGO_EMAIL_SUBJECT_PREFIX", default="[{{cookiecutter.project_name}}]" + "DJANGO_EMAIL_SUBJECT_PREFIX", + default="[{{cookiecutter.project_name}}]", ) # ADMIN diff --git a/{{cookiecutter.project_slug}}/local.yml b/{{cookiecutter.project_slug}}/local.yml index e285f349..6241ceed 100644 --- a/{{cookiecutter.project_slug}}/local.yml +++ b/{{cookiecutter.project_slug}}/local.yml @@ -52,7 +52,6 @@ services: ports: - "7000:7000" command: /start-docs - {%- if cookiecutter.use_mailhog == 'y' %} mailhog: @@ -75,7 +74,7 @@ services: depends_on: - redis - postgres - {% if cookiecutter.use_mailhog == 'y' -%} + {%- if cookiecutter.use_mailhog == 'y' %} - mailhog {%- endif %} ports: [] @@ -88,7 +87,7 @@ services: depends_on: - redis - postgres - {% if cookiecutter.use_mailhog == 'y' -%} + {%- if cookiecutter.use_mailhog == 'y' %} - mailhog {%- endif %} ports: [] diff --git a/{{cookiecutter.project_slug}}/production.yml b/{{cookiecutter.project_slug}}/production.yml index 93b61b13..3cccdb65 100644 --- a/{{cookiecutter.project_slug}}/production.yml +++ b/{{cookiecutter.project_slug}}/production.yml @@ -64,10 +64,9 @@ services: <<: *django image: {{ cookiecutter.project_slug }}_production_flower command: /start-flower - {%- endif %} + {%- if cookiecutter.cloud_provider == 'AWS' %} - {% if cookiecutter.cloud_provider == 'AWS' %} awscli: build: context: . diff --git a/{{cookiecutter.project_slug}}/utility/install_python_dependencies.sh b/{{cookiecutter.project_slug}}/utility/install_python_dependencies.sh index 51793484..e09ebf6f 100755 --- a/{{cookiecutter.project_slug}}/utility/install_python_dependencies.sh +++ b/{{cookiecutter.project_slug}}/utility/install_python_dependencies.sh @@ -33,9 +33,8 @@ if [ -z "$VIRTUAL_ENV" ]; then echo >&2 -e "\n" exit 1; else - pip install -r $PROJECT_DIR/requirements/local.txt - {% if cookiecutter.use_heroku == "y" -%} + {%- if cookiecutter.use_heroku == "y" -%} pip install -r $PROJECT_DIR/requirements.txt {%- endif %} fi diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html index 31da9882..4c4745f7 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html @@ -6,4 +6,5 @@

Forbidden (403)

{% if exception %}{{ exception }}{% else %}You're not allowed to access this page.{% endif %}

-{% endblock content %}{% endraw %} +{% endblock content %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/404.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/404.html index 187c1fc9..d9824185 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/404.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/404.html @@ -6,4 +6,5 @@

Page not found

{% if exception %}{{ exception }}{% else %}This is not the page you were looking for.{% endif %}

-{% endblock content %}{% endraw %} +{% endblock content %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/500.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/500.html index 122e0813..481bb2d0 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/500.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/500.html @@ -9,5 +9,4 @@

We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.

{% endblock content %} - -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/account_inactive.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/account_inactive.html index fe9b6807..0713ff11 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/account_inactive.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/account_inactive.html @@ -9,4 +9,4 @@

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

{% endblock %} -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base.html index cd07bbab..03c86724 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base.html @@ -8,4 +8,4 @@ {% endblock %} -{% endraw %} \ No newline at end of file +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html index 2b7e1278..055904ae 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html @@ -77,4 +77,4 @@ window.addEventListener('DOMContentLoaded',function() { $('.form-group').removeClass('row'); {% endblock %} -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email_confirm.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email_confirm.html index eb45cf60..2a0722a1 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email_confirm.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email_confirm.html @@ -29,4 +29,4 @@ {% endif %} {% endblock %} -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/login.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/login.html index a7193222..247ca690 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/login.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/login.html @@ -45,4 +45,4 @@ for a {{ site_name }} account and sign in below:{% endblocktrans %}

{% endblock %} -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/logout.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/logout.html index baa8183c..6659724e 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/logout.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/logout.html @@ -16,7 +16,5 @@ {% endif %} - - {% endblock %} -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_change.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_change.html index 62bbbc13..7f2fbed0 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_change.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_change.html @@ -14,4 +14,4 @@ {% endblock %} -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset.html index b9869fb2..474b0f4a 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset.html @@ -23,4 +23,4 @@

{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}

{% endblock %} -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_done.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_done.html index cf2129b1..94ea2dfb 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_done.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_done.html @@ -7,11 +7,11 @@ {% block inner %}

{% trans "Password Reset" %}

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

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

{% endblock %} -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html index 671eb12c..66ea9ba6 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html @@ -22,4 +22,4 @@ {% endif %} {% endif %} {% endblock %} -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key_done.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key_done.html index 925b7aa2..7defcc86 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key_done.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key_done.html @@ -7,4 +7,4 @@

{% trans "Change Password" %}

{% trans 'Your password is now changed.' %}

{% endblock %} -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html index 563a0b18..435ed073 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html @@ -14,4 +14,4 @@ {% endblock %} -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup.html index 80490a2e..7a1e29a4 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup.html @@ -20,4 +20,4 @@ {% endblock %} -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup_closed.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup_closed.html index eca9b156..08b93772 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup_closed.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup_closed.html @@ -9,4 +9,4 @@

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

{% endblock %} -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verification_sent.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verification_sent.html index ccc8d9a1..4394e9c6 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verification_sent.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verification_sent.html @@ -10,4 +10,4 @@

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

{% endblock %} -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verified_email_required.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verified_email_required.html index f3078b68..8eafcbed 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verified_email_required.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verified_email_required.html @@ -18,7 +18,5 @@ verification. Please click on the link inside this e-mail. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}

{% blocktrans %}Note: you can still change your e-mail address.{% endblocktrans %}

- - {% endblock %} -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html index 12706887..951b17db 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html @@ -16,26 +16,26 @@ {% block css %} - {% endraw %}{% if cookiecutter.custom_bootstrap_compilation == "n" %}{% raw %} + {%- endraw %}{% if cookiecutter.custom_bootstrap_compilation == "n" %}{% raw %} - {% endraw %}{% endif %}{% raw %} + {%- endraw %}{% endif %}{% raw %} - {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress css %}{% endraw %}{% endif %}{% raw %} + {%- endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress css %}{% endraw %}{% endif %}{% raw %} - {% endraw %}{% if cookiecutter.js_task_runner == "Gulp" and cookiecutter.use_compressor == "n" %}{% raw %} + {%- endraw %}{% if cookiecutter.js_task_runner == "Gulp" and cookiecutter.use_compressor == "n" %}{% raw %} - {% endraw %}{% else %}{% raw %} + {%- endraw %}{% else %}{% raw %} - {% endraw %}{% endif %}{% raw %} - {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %} + {%- endraw %}{% endif %}{% raw %} + {%- endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %} {% endblock %} {# Placed at the top of the document so pages load faster with defer #} {% block javascript %} - {% endraw %}{% if cookiecutter.custom_bootstrap_compilation == "y" and cookiecutter.js_task_runner == "Gulp" %}{% raw %} + {%- endraw %}{% if cookiecutter.custom_bootstrap_compilation == "y" and cookiecutter.js_task_runner == "Gulp" %}{% raw %} {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress js %}{% endraw %}{% endif %}{% raw %} @@ -47,12 +47,12 @@ - {% endraw %}{% endif %}{% raw %} + {%- endraw %}{% endif %}{% raw %} - {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress js %}{% endraw %}{% endif %}{% raw %} + {%- endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress js %}{% endraw %}{% endif %}{% raw %} - {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %} + {%- endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %} {% endblock javascript %} @@ -121,4 +121,4 @@ {% endblock inline_javascript %} - {% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/pages/about.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/pages/about.html index 94beff9c..8968a3d4 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/pages/about.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/pages/about.html @@ -1 +1 @@ -{% raw %}{% extends "base.html" %}{% endraw %} \ No newline at end of file +{% raw %}{% extends "base.html" %}{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/pages/home.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/pages/home.html index 94beff9c..8968a3d4 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/pages/home.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/pages/home.html @@ -1 +1 @@ -{% raw %}{% extends "base.html" %}{% endraw %} \ No newline at end of file +{% raw %}{% extends "base.html" %}{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_detail.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_detail.html index 47b61122..eed39ca3 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_detail.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_detail.html @@ -30,7 +30,6 @@ {% endif %} - {% endblock content %} -{% endraw %} +{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_form.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_form.html index e9da0d48..53e14a53 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_form.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_form.html @@ -14,4 +14,5 @@ -{% endblock %}{% endraw %} +{% endblock %} +{%- endraw %} From c7bb4834e03ef022f7f80ccbf871e8ebc0704720 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 3 Mar 2021 19:50:13 +0000 Subject: [PATCH 48/51] Fix pre-commit hook issues with Docker & Celery --- {{cookiecutter.project_slug}}/.envs/.local/.django | 2 +- {{cookiecutter.project_slug}}/compose/local/django/start | 2 +- .../compose/production/aws/maintenance/download | 1 - .../compose/production/aws/maintenance/upload | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.envs/.local/.django b/{{cookiecutter.project_slug}}/.envs/.local/.django index 919f3118..ef581a1c 100644 --- a/{{cookiecutter.project_slug}}/.envs/.local/.django +++ b/{{cookiecutter.project_slug}}/.envs/.local/.django @@ -14,4 +14,4 @@ REDIS_URL=redis://redis:6379/0 # Flower CELERY_FLOWER_USER=!!!SET CELERY_FLOWER_USER!!! CELERY_FLOWER_PASSWORD=!!!SET CELERY_FLOWER_PASSWORD!!! -{% endif %} +{%- endif %} diff --git a/{{cookiecutter.project_slug}}/compose/local/django/start b/{{cookiecutter.project_slug}}/compose/local/django/start index 660eda34..9cbb6c89 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/start +++ b/{{cookiecutter.project_slug}}/compose/local/django/start @@ -10,4 +10,4 @@ python manage.py migrate uvicorn config.asgi:application --host 0.0.0.0 --reload {%- else %} python manage.py runserver_plus 0.0.0.0:8000 -{% endif %} +{%- endif %} diff --git a/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/download b/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/download index 8d5ea091..0c515935 100644 --- a/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/download +++ b/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/download @@ -21,4 +21,3 @@ export AWS_STORAGE_BUCKET_NAME="${DJANGO_AWS_STORAGE_BUCKET_NAME}" aws s3 cp s3://${AWS_STORAGE_BUCKET_NAME}${BACKUP_DIR_PATH}/${1} ${BACKUP_DIR_PATH}/${1} message_success "Finished downloading ${1}." - diff --git a/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/upload b/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/upload index 4a89dcb5..9446b930 100644 --- a/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/upload +++ b/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/upload @@ -27,4 +27,3 @@ message_info "Cleaning the directory ${BACKUP_DIR_PATH}" rm -rf ${BACKUP_DIR_PATH}/* message_success "Finished uploading and cleaning." - From e08b17a234c6a7dbafcb72bd7d95a6036184e380 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 3 Mar 2021 19:53:56 +0000 Subject: [PATCH 49/51] Run pre-commit for linting in Docker --- requirements.txt | 1 + tests/test_bare.sh | 1 + tests/test_docker.sh | 10 +++++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 3b16db8d..b4ae9467 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,6 +8,7 @@ black==20.8b1 isort==5.8.0 flake8==3.9.0 flake8-isort==4.0.0 +pre-commit==2.10.1 # Testing # ------------------------------------------------------------------------------ diff --git a/tests/test_bare.sh b/tests/test_bare.sh index c7938ecf..1f52d91b 100755 --- a/tests/test_bare.sh +++ b/tests/test_bare.sh @@ -28,6 +28,7 @@ sudo utility/install_os_dependencies.sh install pip install -r requirements/local.txt # Lint by running pre-commit on all files +# Needs a git repo to find the project root git init git add . pre-commit run --show-diff-on-failure -a diff --git a/tests/test_docker.sh b/tests/test_docker.sh index f6df6b8a..001ef06d 100755 --- a/tests/test_docker.sh +++ b/tests/test_docker.sh @@ -17,12 +17,16 @@ cd .cache/docker cookiecutter ../../ --no-input --overwrite-if-exists use_docker=y $@ cd my_awesome_project +# Lint by running pre-commit on all files +# Needs a git repo to find the project root +# We don't have git inside Docker, so run it outside +git init +git add . +pre-commit run --show-diff-on-failure -a + # run the project's type checks docker-compose -f local.yml run django mypy my_awesome_project -# Run black with --check option -docker-compose -f local.yml run django black --check --diff --exclude 'migrations' ./ - # run the project's tests docker-compose -f local.yml run django pytest From 382dce2803a9a74b4ec1490abd421c9635ccf550 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 3 Mar 2021 20:00:18 +0000 Subject: [PATCH 50/51] Fix linting issues in Gulpfile --- {{cookiecutter.project_slug}}/gulpfile.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/{{cookiecutter.project_slug}}/gulpfile.js b/{{cookiecutter.project_slug}}/gulpfile.js index 206f8a01..56a08e8f 100644 --- a/{{cookiecutter.project_slug}}/gulpfile.js +++ b/{{cookiecutter.project_slug}}/gulpfile.js @@ -29,14 +29,14 @@ function pathsConfig(appName) { const vendorsRoot = 'node_modules' return { - {% if cookiecutter.custom_bootstrap_compilation == 'y' %} + {%- if cookiecutter.custom_bootstrap_compilation == 'y' %} bootstrapSass: `${vendorsRoot}/bootstrap/scss`, vendorsJs: [ `${vendorsRoot}/jquery/dist/jquery.slim.js`, `${vendorsRoot}/popper.js/dist/umd/popper.js`, `${vendorsRoot}/bootstrap/dist/js/bootstrap.js`, ], - {% endif %} + {%- endif %} app: this.app, templates: `${this.app}/templates`, css: `${this.app}/static/css`, @@ -67,9 +67,9 @@ function styles() { return src(`${paths.sass}/project.scss`) .pipe(sass({ includePaths: [ - {% if cookiecutter.custom_bootstrap_compilation == 'y' %} + {%- if cookiecutter.custom_bootstrap_compilation == 'y' %} paths.bootstrapSass, - {% endif %} + {%- endif %} paths.sass ] }).on('error', sass.logError)) @@ -90,7 +90,7 @@ function scripts() { .pipe(dest(paths.js)) } -{% if cookiecutter.custom_bootstrap_compilation == 'y' %} +{%- if cookiecutter.custom_bootstrap_compilation == 'y' %} // Vendor Javascript minification function vendorScripts() { return src(paths.vendorsJs) @@ -101,7 +101,7 @@ function vendorScripts() { .pipe(rename({ suffix: '.min' })) .pipe(dest(paths.js)) } -{% endif %} +{%- endif %} // Image compression function imgCompression() { @@ -110,7 +110,7 @@ function imgCompression() { .pipe(dest(paths.images)) } -{% if cookiecutter.use_async == 'y' -%} +{%- if cookiecutter.use_async == 'y' -%} // Run django server function asyncRunServer() { var cmd = spawn('gunicorn', [ @@ -143,7 +143,7 @@ function initBrowserSync() { // https://www.browsersync.io/docs/options/#option-proxy {%- if cookiecutter.use_docker == 'n' %} proxy: 'localhost:8000' - {% else %} + {%- else %} proxy: { target: 'django:8000', proxyReq: [ @@ -172,7 +172,7 @@ function watchPaths() { const generateAssets = parallel( styles, scripts, - {% if cookiecutter.custom_bootstrap_compilation == 'y' %}vendorScripts,{% endif %} + {%- if cookiecutter.custom_bootstrap_compilation == 'y' %}vendorScripts,{% endif %} imgCompression ) From 675cef0a95b5ee48ca0ab2cb84258878364d9065 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 3 Mar 2021 20:02:32 +0000 Subject: [PATCH 51/51] Fix linting issues in template --- .../{{cookiecutter.project_slug}}/templates/base.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html index 951b17db..c3679404 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html @@ -37,10 +37,10 @@ {% block javascript %} {%- endraw %}{% if cookiecutter.custom_bootstrap_compilation == "y" and cookiecutter.js_task_runner == "Gulp" %}{% raw %} - {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress js %}{% endraw %}{% endif %}{% raw %} + {%- endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress js %}{% endraw %}{% endif %}{% raw %} - {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %} - {% endraw %}{% else %}{% raw %} + {%- endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %} + {%- endraw %}{% else %}{% raw %}