From 53ffbbcf2ea9ec330e1ea68a9ccad7fd47b94059 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Fri, 11 Sep 2020 22:00:50 +0530 Subject: [PATCH 001/146] Multi stage Python build for Django --- .../compose/local/django/Dockerfile | 61 ++++++++++++++----- .../compose/production/django/Dockerfile | 58 ++++++++++++------ 2 files changed, 87 insertions(+), 32 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index 5473f114e..949235c04 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -1,23 +1,32 @@ +# Python build stage +FROM python:3.8-slim-buster as python-build-stage +ENV PYTHONDONTWRITEBYTECODE 1 + +# Requirements are installed here to ensure they will be cached. +COPY ./requirements /requirements + +RUN apt-get update && apt-get install --no-install-recommends -y \ + # dependencies for building Python packages + build-essential \ + # psycopg2 dependencies + libpq-dev \ + # Translations dependencies + gettext \ + # cleaning up unused files + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + && rm -rf /var/lib/apt/lists/* \ + # create python dependency wheels + && pip wheel --no-cache-dir --no-deps --use-feature=2020-resolver --wheel-dir /usr/src/app/wheels -r /requirements/production.txt \ + && rm -rf /requirements + + + +# Python 'run' stage FROM python:3.8-slim-buster ENV PYTHONUNBUFFERED 1 ENV PYTHONDONTWRITEBYTECODE 1 -RUN apt-get update \ - # dependencies for building Python packages - && apt-get install -y build-essential \ - # psycopg2 dependencies - && apt-get install -y libpq-dev \ - # Translations dependencies - && apt-get install -y gettext \ - # cleaning up unused files - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - && rm -rf /var/lib/apt/lists/* - -# Requirements are installed here to ensure they will be cached. -COPY ./requirements /requirements -RUN pip install -r /requirements/local.txt - COPY ./compose/production/django/entrypoint /entrypoint RUN sed -i 's/\r$//g' /entrypoint RUN chmod +x /entrypoint @@ -25,6 +34,7 @@ RUN chmod +x /entrypoint COPY ./compose/local/django/start /start RUN sed -i 's/\r$//g' /start RUN chmod +x /start + {% if cookiecutter.use_celery == "y" %} COPY ./compose/local/django/celery/worker/start /start-celeryworker RUN sed -i 's/\r$//g' /start-celeryworker @@ -38,6 +48,27 @@ COPY ./compose/local/django/celery/flower/start /start-flower RUN sed -i 's/\r$//g' /start-flower RUN chmod +x /start-flower {% endif %} + + +# installing required system dependencies +RUN apt-get update && apt-get install --no-install-recommends -y \ + # psycopg2 dependencies + libpq-dev \ + # Translations dependencies + gettext \ + # cleaning up unused files + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + && rm -rf /var/lib/apt/lists/* + + +# copy python dependency wheels from python-build-stage +COPY --from=python-build-stage /usr/src/app/wheels /wheels + +# install python dependencies +RUN pip install --no-cache /wheels/* + + + WORKDIR /app ENTRYPOINT ["/entrypoint"] diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 2e6a195b7..9fd75f7e9 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -7,31 +7,38 @@ RUN npm install && npm cache clean --force COPY . /app RUN npm run build -# Python build stage {%- endif %} + +# Python build stage +FROM python:3.8-slim-buster as python-build-stage + + +# Requirements are installed here to ensure they will be cached. +COPY ./requirements /requirements + +RUN apt-get update && apt-get install --no-install-recommends -y \ + # dependencies for building Python packages + build-essential \ + # psycopg2 dependencies + libpq-dev \ + # Translations dependencies + gettext \ + # cleaning up unused files + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + && rm -rf /var/lib/apt/lists/* \ + # create python dependency wheels + && pip wheel --no-cache-dir --no-deps --use-feature=2020-resolver --wheel-dir /usr/src/app/wheels -r /requirements/production.txt \ + && rm -rf /requirements + + +# Python 'run' stage FROM python:3.8-slim-buster ENV PYTHONUNBUFFERED 1 -RUN apt-get update \ - # dependencies for building Python packages - && apt-get install -y build-essential \ - # psycopg2 dependencies - && apt-get install -y libpq-dev \ - # Translations dependencies - && apt-get install -y gettext \ - # cleaning up unused files - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - && rm -rf /var/lib/apt/lists/* - RUN addgroup --system django \ && adduser --system --ingroup django django -# Requirements are installed here to ensure they will be cached. -COPY ./requirements /requirements -RUN pip install --no-cache-dir -r /requirements/production.txt \ - && rm -rf /requirements - COPY --chown=django:django ./compose/production/django/entrypoint /entrypoint RUN sed -i 's/\r$//g' /entrypoint RUN chmod +x /entrypoint @@ -58,6 +65,23 @@ RUN sed -i 's/\r$//g' /start-flower RUN chmod +x /start-flower {%- endif %} +# installing required system dependencies +RUN apt-get update && apt-get install --no-install-recommends -y \ + # psycopg2 dependencies + libpq-dev \ + # Translations dependencies + gettext \ + # cleaning up unused files + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + && rm -rf /var/lib/apt/lists/* + + +# copy python dependency wheels from python-build-stage +COPY --from=python-build-stage /usr/src/app/wheels /wheels + +# install python dependencies +RUN pip install --no-cache /wheels/* + {%- if cookiecutter.js_task_runner == 'Gulp' %} COPY --from=client-builder --chown=django:django /app /app {% else %} From 070d4556f9147979aa81a0300b36fb8c561bea81 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Fri, 11 Sep 2020 22:04:44 +0530 Subject: [PATCH 002/146] Multi stage Python build for Django --- .../compose/production/traefik/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile index aa879052b..26a653d50 100644 --- a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile @@ -1,4 +1,4 @@ -FROM traefik:v2.2.11 +FROM traefik:v2.0 RUN mkdir -p /etc/traefik/acme \ && touch /etc/traefik/acme/acme.json \ && chmod 600 /etc/traefik/acme/acme.json From 07051bff33e489834f3d0b88954ddf3709cd74c7 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Sat, 12 Sep 2020 08:47:38 +0530 Subject: [PATCH 003/146] Fixed mistake of using production settings even for local/django image --- {{cookiecutter.project_slug}}/compose/local/django/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index 949235c04..5c3e3f1a8 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -16,7 +16,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ && rm -rf /var/lib/apt/lists/* \ # create python dependency wheels - && pip wheel --no-cache-dir --no-deps --use-feature=2020-resolver --wheel-dir /usr/src/app/wheels -r /requirements/production.txt \ + && pip wheel --no-cache-dir --no-deps --use-feature=2020-resolver --wheel-dir /usr/src/app/wheels -r /requirements/local.txt \ && rm -rf /requirements From a795086b108c23d8e886762c3b9f06033e610352 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Sat, 12 Sep 2020 11:04:08 +0530 Subject: [PATCH 004/146] Removing using python wheels to build python dependecies due to issue resolving conflicts in package sub-dependencies. Ends up being much more trouble than it's worth. --- .../compose/local/django/Dockerfile | 11 +++++------ .../compose/production/django/Dockerfile | 15 +++++++-------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index 5c3e3f1a8..a7cf54aee 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -15,8 +15,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ # cleaning up unused files && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ && rm -rf /var/lib/apt/lists/* \ - # create python dependency wheels - && pip wheel --no-cache-dir --no-deps --use-feature=2020-resolver --wheel-dir /usr/src/app/wheels -r /requirements/local.txt \ + # install python dependencies + && pip install --no-cache-dir --use-feature=2020-resolver -r /requirements/local.txt \ && rm -rf /requirements @@ -61,11 +61,10 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ && rm -rf /var/lib/apt/lists/* -# copy python dependency wheels from python-build-stage -COPY --from=python-build-stage /usr/src/app/wheels /wheels -# install python dependencies -RUN pip install --no-cache /wheels/* +# copy python dependencies from python-build-stage +COPY --from=build_stage /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/ +COPY --from=build_stage /usr/local/bin/ /usr/local/bin/ diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 9fd75f7e9..15708dcd8 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -11,7 +11,7 @@ RUN npm run build # Python build stage FROM python:3.8-slim-buster as python-build-stage - +ENV PYTHONDONTWRITEBYTECODE 1 # Requirements are installed here to ensure they will be cached. COPY ./requirements /requirements @@ -26,14 +26,15 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ # cleaning up unused files && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ && rm -rf /var/lib/apt/lists/* \ - # create python dependency wheels - && pip wheel --no-cache-dir --no-deps --use-feature=2020-resolver --wheel-dir /usr/src/app/wheels -r /requirements/production.txt \ + # install python dependencies + && pip install --no-cache-dir --use-feature=2020-resolver -r /requirements/production.txt \ && rm -rf /requirements # Python 'run' stage FROM python:3.8-slim-buster +ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 RUN addgroup --system django \ @@ -76,11 +77,9 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ && rm -rf /var/lib/apt/lists/* -# copy python dependency wheels from python-build-stage -COPY --from=python-build-stage /usr/src/app/wheels /wheels - -# install python dependencies -RUN pip install --no-cache /wheels/* +# copy python dependencies from python-build-stage +COPY --from=build_stage /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/ +COPY --from=build_stage /usr/local/bin/ /usr/local/bin/ {%- if cookiecutter.js_task_runner == 'Gulp' %} COPY --from=client-builder --chown=django:django /app /app From 17e577c92478664627be6ded8501545a5d5b2115 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Sat, 12 Sep 2020 11:11:19 +0530 Subject: [PATCH 005/146] Fixed Typo with python build stage name that was references incorrectly in the run stage --- {{cookiecutter.project_slug}}/compose/local/django/Dockerfile | 4 ++-- .../compose/production/django/Dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index a7cf54aee..11cc99784 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -63,8 +63,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ # copy python dependencies from python-build-stage -COPY --from=build_stage /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/ -COPY --from=build_stage /usr/local/bin/ /usr/local/bin/ +COPY --from=python-build-stage /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/ +COPY --from=python-build-stage /usr/local/bin/ /usr/local/bin/ diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 15708dcd8..722f709fb 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -78,8 +78,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ # copy python dependencies from python-build-stage -COPY --from=build_stage /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/ -COPY --from=build_stage /usr/local/bin/ /usr/local/bin/ +COPY --from=python-build-stage /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/ +COPY --from=python-build-stage /usr/local/bin/ /usr/local/bin/ {%- if cookiecutter.js_task_runner == 'Gulp' %} COPY --from=client-builder --chown=django:django /app /app From 079db28661a5a30066dc67da57b728741a04b986 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Mon, 14 Sep 2020 01:41:33 +0530 Subject: [PATCH 006/146] Changed when Requirements are copied and installed to improve incremental image build times. The extra image layer is inconsequential since python-build-stage layers are discarded anyway. --- .../compose/local/django/Dockerfile | 17 +++++++++-------- .../compose/production/django/Dockerfile | 16 ++++++++-------- .../compose/production/traefik/Dockerfile | 2 +- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index 11cc99784..645b04766 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -2,9 +2,6 @@ FROM python:3.8-slim-buster as python-build-stage ENV PYTHONDONTWRITEBYTECODE 1 -# Requirements are installed here to ensure they will be cached. -COPY ./requirements /requirements - RUN apt-get update && apt-get install --no-install-recommends -y \ # dependencies for building Python packages build-essential \ @@ -14,15 +11,19 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ gettext \ # cleaning up unused files && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - && rm -rf /var/lib/apt/lists/* \ - # install python dependencies - && pip install --no-cache-dir --use-feature=2020-resolver -r /requirements/local.txt \ - && rm -rf /requirements + && rm -rf /var/lib/apt/lists/* + +# Requirements are installed here to ensure they will be cached. +COPY ./requirements /requirements + +# install python dependencies +RUN pip install --no-cache-dir --use-feature=2020-resolver -r /requirements/local.txt \ + && rm -rf /requirements # Python 'run' stage -FROM python:3.8-slim-buster +FROM python:3.8-slim-buster as python-run-stage ENV PYTHONUNBUFFERED 1 ENV PYTHONDONTWRITEBYTECODE 1 diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 722f709fb..cc46464bb 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -13,9 +13,6 @@ RUN npm run build FROM python:3.8-slim-buster as python-build-stage ENV PYTHONDONTWRITEBYTECODE 1 -# Requirements are installed here to ensure they will be cached. -COPY ./requirements /requirements - RUN apt-get update && apt-get install --no-install-recommends -y \ # dependencies for building Python packages build-essential \ @@ -25,14 +22,17 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ gettext \ # cleaning up unused files && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - && rm -rf /var/lib/apt/lists/* \ - # install python dependencies - && pip install --no-cache-dir --use-feature=2020-resolver -r /requirements/production.txt \ - && rm -rf /requirements + && rm -rf /var/lib/apt/lists/* +# Requirements are installed here to ensure they will be cached. +COPY ./requirements /requirements + +# install python dependencies +Run pip install --no-cache-dir --use-feature=2020-resolver -r /requirements/production.txt \ + && rm -rf /requirements # Python 'run' stage -FROM python:3.8-slim-buster +FROM python:3.8-slim-buster as python-run-stage ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile index 26a653d50..aa879052b 100644 --- a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile @@ -1,4 +1,4 @@ -FROM traefik:v2.0 +FROM traefik:v2.2.11 RUN mkdir -p /etc/traefik/acme \ && touch /etc/traefik/acme/acme.json \ && chmod 600 /etc/traefik/acme/acme.json From 4a52845a269584ade6c3198c84705a95f1e6ef78 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Wed, 16 Sep 2020 15:24:16 +0530 Subject: [PATCH 007/146] Replaced copying python package directories with wheel files which are then used to install all requirements. This way the generated images would be a lot more stable as well. Size increases by 2-3mb though --- .../compose/local/django/Dockerfile | 20 ++++++++--------- .../compose/production/django/Dockerfile | 22 ++++++++++++------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index 645b04766..c34f8ad40 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -7,19 +7,18 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ build-essential \ # psycopg2 dependencies libpq-dev \ - # Translations dependencies - gettext \ # cleaning up unused files && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ && rm -rf /var/lib/apt/lists/* + # Requirements are installed here to ensure they will be cached. COPY ./requirements /requirements -# install python dependencies -RUN pip install --no-cache-dir --use-feature=2020-resolver -r /requirements/local.txt \ - && rm -rf /requirements - +# create python dependency wheels +RUN pip wheel --no-cache-dir --no-deps --use-feature=2020-resolver --wheel-dir /usr/src/app/wheels \ + -r /requirements/local.txt \ + && rm -rf /requirements # Python 'run' stage @@ -62,11 +61,12 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ && rm -rf /var/lib/apt/lists/* +# copy python dependency wheels from python-build-stage +COPY --from=python-build-stage /usr/src/app/wheels /wheels -# copy python dependencies from python-build-stage -COPY --from=python-build-stage /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/ -COPY --from=python-build-stage /usr/local/bin/ /usr/local/bin/ - +# use wheels to install python dependencies +RUN pip install --no-cache /wheels/* \ + && rm -rf /wheels WORKDIR /app diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index cc46464bb..a2f432ccc 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -11,25 +11,28 @@ RUN npm run build # Python build stage FROM python:3.8-slim-buster as python-build-stage + ENV PYTHONDONTWRITEBYTECODE 1 +ARG BUILD_ENVIRONMENT + RUN apt-get update && apt-get install --no-install-recommends -y \ # dependencies for building Python packages build-essential \ # psycopg2 dependencies libpq-dev \ - # Translations dependencies - gettext \ # cleaning up unused files && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ && rm -rf /var/lib/apt/lists/* + # Requirements are installed here to ensure they will be cached. COPY ./requirements /requirements -# install python dependencies -Run pip install --no-cache-dir --use-feature=2020-resolver -r /requirements/production.txt \ - && rm -rf /requirements +# create python dependency wheels +RUN pip wheel --no-cache-dir --no-deps --use-feature=2020-resolver --wheel-dir /usr/src/app/wheels \ + -r /requirements/production.txt \ + && rm -rf /requirements # Python 'run' stage FROM python:3.8-slim-buster as python-run-stage @@ -77,9 +80,12 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ && rm -rf /var/lib/apt/lists/* -# copy python dependencies from python-build-stage -COPY --from=python-build-stage /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/ -COPY --from=python-build-stage /usr/local/bin/ /usr/local/bin/ +# copy python dependency wheels from python-build-stage +COPY --from=python-build-stage /usr/src/app/wheels /wheels + +# use wheels to install python dependencies +RUN pip install --no-cache /wheels/* \ + && rm -rf /wheels {%- if cookiecutter.js_task_runner == 'Gulp' %} COPY --from=client-builder --chown=django:django /app /app From 86e9a90d4ee11dd1756ad164da9de1b8c42d50a9 Mon Sep 17 00:00:00 2001 From: lcd1232 <8745863+lcd1232@users.noreply.github.com> Date: Wed, 30 Sep 2020 11:14:21 +0300 Subject: [PATCH 008/146] Add node to INTERNAL_IPS --- {{cookiecutter.project_slug}}/config/settings/local.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py index 21e6a8dfc..e7f8a2c1e 100644 --- a/{{cookiecutter.project_slug}}/config/settings/local.py +++ b/{{cookiecutter.project_slug}}/config/settings/local.py @@ -69,6 +69,8 @@ if env("USE_DOCKER") == "yes": hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips] + _, _, ips = socket.gethostbyname_ex("node") + INTERNAL_IPS.extend(ips) {%- endif %} # django-extensions From f5bfa97f6ea0b79229c96fc28c740834e0c0f538 Mon Sep 17 00:00:00 2001 From: lcd1232 <8745863+lcd1232@users.noreply.github.com> Date: Sun, 4 Oct 2020 19:31:09 +0300 Subject: [PATCH 009/146] Update {{cookiecutter.project_slug}}/config/settings/local.py Co-authored-by: Bruno Alla --- {{cookiecutter.project_slug}}/config/settings/local.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py index e7f8a2c1e..c69042d53 100644 --- a/{{cookiecutter.project_slug}}/config/settings/local.py +++ b/{{cookiecutter.project_slug}}/config/settings/local.py @@ -69,8 +69,10 @@ if env("USE_DOCKER") == "yes": hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips] + {%- if cookiecutter.js_task_runner == 'Gulp' %} _, _, ips = socket.gethostbyname_ex("node") INTERNAL_IPS.extend(ips) + {%- endif %} {%- endif %} # django-extensions From 3a1e94f41cb2c94e9455a2eb247c5d7085ac5255 Mon Sep 17 00:00:00 2001 From: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Date: Fri, 1 Jan 2021 22:40:30 -0500 Subject: [PATCH 010/146] Use exception var in 403.html if available --- .../{{cookiecutter.project_slug}}/templates/403.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html index c02bd4e9e..49c82a9d7 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html @@ -5,5 +5,5 @@ {% block content %}

Forbidden (403)

-

CSRF verification failed. Request aborted.

+

{% if exception %}{{ exception }}{% else %}CSRF verification failed. Request aborted.{% endif %}

{% endblock content %}{% endraw %} From ac0af4c178029adb2ab08ad94f79994233179e2c Mon Sep 17 00:00:00 2001 From: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Date: Fri, 1 Jan 2021 22:44:02 -0500 Subject: [PATCH 011/146] Use exception var in 404.html if available --- .../{{cookiecutter.project_slug}}/templates/404.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/404.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/404.html index 1687ef311..187c1fc9d 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/404.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/404.html @@ -5,5 +5,5 @@ {% block content %}

Page not found

-

This is not the page you were looking for.

+

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

{% endblock content %}{% endraw %} From cbb3cdb2b1320aae296b638564546084f0cb49a9 Mon Sep 17 00:00:00 2001 From: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Date: Mon, 25 Jan 2021 11:20:34 -0500 Subject: [PATCH 012/146] Update admin to ignore *_name User attributes Fixes #3016 --- .../users/admin.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py index a68a94a95..700311482 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py @@ -12,8 +12,22 @@ class UserAdmin(auth_admin.UserAdmin): form = UserChangeForm add_form = UserCreationForm - fieldsets = (("User", {"fields": ("name",)}),) + tuple( - auth_admin.UserAdmin.fieldsets + fieldsets = ( + (None, {"fields": ("username", "password")}), + (_("Personal info"), {"fields": ("name", "email")}), + ( + _("Permissions"), + { + "fields": ( + "is_active", + "is_staff", + "is_superuser", + "groups", + "user_permissions", + ), + }, + ), + (_("Important dates"), {"fields": ("last_login", "date_joined")}), ) list_display = ["username", "name", "is_superuser"] search_fields = ["name"] From d1409e2fb3962c66f8c7829f6b2456b50aca40e5 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 25 Jan 2021 21:08:33 +0000 Subject: [PATCH 013/146] Missing import --- .../{{cookiecutter.project_slug}}/users/admin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py index 700311482..8e8e3eb2f 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py @@ -1,6 +1,7 @@ from django.contrib import admin from django.contrib.auth import admin as auth_admin from django.contrib.auth import get_user_model +from django.utils.translation import gettext_lazy as _ from {{ cookiecutter.project_slug }}.users.forms import UserChangeForm, UserCreationForm From 37e0d6ae04da6b127e214afba1d8d1adabfa707e Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 25 Jan 2021 21:55:14 +0000 Subject: [PATCH 014/146] Add test for the UserAdmin --- .../users/tests/test_admin.py | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py new file mode 100644 index 000000000..ee9f70ed5 --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py @@ -0,0 +1,40 @@ +import pytest +from django.urls import reverse + +from {{ cookiecutter.project_slug }}.users.models import User + +pytestmark = pytest.mark.django_db + + +class TestUserAdmin: + def test_changelist(self, admin_client): + url = reverse("admin:users_user_changelist") + response = admin_client.get(url) + assert response.status_code == 200 + + def test_search(self, admin_client): + url = reverse("admin:users_user_changelist") + response = admin_client.get(url, data={"q": "test"}) + assert response.status_code == 200 + + def test_add(self, admin_client): + url = reverse("admin:users_user_add") + response = admin_client.get(url) + assert response.status_code == 200 + + response = admin_client.post( + url, + data={ + "username": "test", + "password1": "My_R@ndom-P@ssw0rd", + "password2": "My_R@ndom-P@ssw0rd", + }, + ) + assert response.status_code == 302 + assert User.objects.filter(username="test").exists() + + def test_view_user(self, admin_client): + user = User.objects.first() + url = reverse("admin:users_user_change", kwargs={"object_id": user.pk}) + response = admin_client.get(url) + assert response.status_code == 200 From d12d01d325e662d565fb358575aa0f8caede1642 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 25 Jan 2021 22:13:19 +0000 Subject: [PATCH 015/146] Fix mypy error --- .../{{cookiecutter.project_slug}}/users/tests/test_admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py index ee9f70ed5..c50a4be4c 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_admin.py @@ -34,7 +34,7 @@ class TestUserAdmin: assert User.objects.filter(username="test").exists() def test_view_user(self, admin_client): - user = User.objects.first() + user = User.objects.get(username="admin") url = reverse("admin:users_user_change", kwargs={"object_id": user.pk}) response = admin_client.get(url) assert response.status_code == 200 From d5d42b179726b00660ab284ce7819b688bb520bb Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 26 Jan 2021 10:51:06 -0800 Subject: [PATCH 016/146] Update coverage from 5.3.1 to 5.4 --- {{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 c34862a9a..e5919ee37 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.3.1 # https://github.com/nedbat/coveragepy +coverage==5.4 # 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 8e031e760ff8b391fcc4dbb6a7d209aa36937666 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 27 Jan 2021 02:35:54 +0000 Subject: [PATCH 017/146] Update Changelog --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c5999159..1a246a3eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## [2021-01-26] +### Changed +- Bump peter-evans/create-pull-request from v3.6.0 to v3.7.0 ([#3022](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3022)) +- Using SuccessMessageMixin to send success message to django template ([#3021](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3021)) +### Fixed +- Update admin to ignore *_name User attributes ([#3018](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3018)) +### Updated +- Update coverage to 5.4 ([#3024](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3024)) +- Update pytest to 6.2.2 ([#3020](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3020)) +- Update django-cors-headers to 3.7.0 ([#3019](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3019)) + ## [2021-01-24] ### Changed - Use defer for script tags (Fix #2922) ([#2927](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/2927)) From 9969f8fa0da67de61f7583d319bf8a741a3e281f Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 28 Jan 2021 09:19:14 +0000 Subject: [PATCH 018/146] Handle error if node hasn't started yet --- {{cookiecutter.project_slug}}/config/settings/local.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py index c69042d53..3ce150e1c 100644 --- a/{{cookiecutter.project_slug}}/config/settings/local.py +++ b/{{cookiecutter.project_slug}}/config/settings/local.py @@ -70,8 +70,12 @@ if env("USE_DOCKER") == "yes": hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips] {%- if cookiecutter.js_task_runner == 'Gulp' %} - _, _, ips = socket.gethostbyname_ex("node") - INTERNAL_IPS.extend(ips) + try: + _, _, ips = socket.gethostbyname_ex("node") + INTERNAL_IPS.extend(ips) + except socket.gaierror: + # The node container isn't started (yet?) + pass {%- endif %} {%- endif %} From 7b92bc388d3150c7f810a901a93888cb4b471a86 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 28 Jan 2021 10:46:03 +0000 Subject: [PATCH 019/146] Update deprecated `scale` command to `up --scale` The scale command is deprecated: Use the up command with the `--scale` flag instead. --- docs/deployment-with-docker.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/deployment-with-docker.rst b/docs/deployment-with-docker.rst index 01df2e44d..fcce7e6f5 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -124,8 +124,8 @@ To check the logs out, run:: If you want to scale your application, run:: - docker-compose -f production.yml scale django=4 - docker-compose -f production.yml scale celeryworker=2 + docker-compose -f production.yml up --scale django=4 + docker-compose -f production.yml up --scale celeryworker=2 .. warning:: don't try to scale ``postgres``, ``celerybeat``, or ``traefik``. From f0ae5ebfe75e9452cec96962d0426aea491c0bbf Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 28 Jan 2021 02:46:12 -0800 Subject: [PATCH 020/146] Update tox from 3.21.2 to 3.21.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 87161a2e1..6f389476f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8-isort==4.0.0 # Testing # ------------------------------------------------------------------------------ -tox==3.21.2 +tox==3.21.3 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 7bfac19625f9c53e23372e9b6e46b8c50c5aa1ae Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 28 Jan 2021 09:24:34 -0800 Subject: [PATCH 021/146] Update django-anymail from 8.1 to 8.2 --- {{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 4a610d0c4..f5bf3ca99 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -22,7 +22,7 @@ django-storages[boto3]==1.11.1 # https://github.com/jschneier/django-storages django-storages[google]==1.11.1 # https://github.com/jschneier/django-storages {%- endif %} {%- if cookiecutter.mail_service == 'Mailgun' %} -django-anymail[mailgun]==8.1 # https://github.com/anymail/django-anymail +django-anymail[mailgun]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Amazon SES' %} django-anymail[amazon_ses]==8.1 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Mailjet' %} From f9b0b5a4222f0fe233528df17ec2e082c9fd15ec Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 28 Jan 2021 09:24:35 -0800 Subject: [PATCH 022/146] Update django-anymail from 8.1 to 8.2 --- {{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 f5bf3ca99..004375dcb 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -24,7 +24,7 @@ django-storages[google]==1.11.1 # https://github.com/jschneier/django-storages {%- if cookiecutter.mail_service == 'Mailgun' %} django-anymail[mailgun]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Amazon SES' %} -django-anymail[amazon_ses]==8.1 # https://github.com/anymail/django-anymail +django-anymail[amazon_ses]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Mailjet' %} django-anymail[mailjet]==8.1 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Mandrill' %} From 346c91c7613c910c1a00fa3c3010fc56c6d0ceba Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 28 Jan 2021 09:24:35 -0800 Subject: [PATCH 023/146] Update django-anymail from 8.1 to 8.2 --- {{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 004375dcb..c1b8a9642 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -26,7 +26,7 @@ django-anymail[mailgun]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Amazon SES' %} django-anymail[amazon_ses]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Mailjet' %} -django-anymail[mailjet]==8.1 # https://github.com/anymail/django-anymail +django-anymail[mailjet]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Mandrill' %} django-anymail[mandrill]==8.1 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Postmark' %} From 70adb225292c901b24ecd03d4d52cd059a2eb4d8 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 28 Jan 2021 09:24:36 -0800 Subject: [PATCH 024/146] Update django-anymail from 8.1 to 8.2 --- {{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 c1b8a9642..b5766bc14 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -28,7 +28,7 @@ django-anymail[amazon_ses]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Mailjet' %} django-anymail[mailjet]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Mandrill' %} -django-anymail[mandrill]==8.1 # https://github.com/anymail/django-anymail +django-anymail[mandrill]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Postmark' %} django-anymail[postmark]==8.1 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Sendgrid' %} From dceee9bb5ca3b124a0bf8efe75ec1aabb2262b38 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 28 Jan 2021 09:24:37 -0800 Subject: [PATCH 025/146] Update django-anymail from 8.1 to 8.2 --- {{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 b5766bc14..dc6a0a42e 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -30,7 +30,7 @@ django-anymail[mailjet]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Mandrill' %} django-anymail[mandrill]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Postmark' %} -django-anymail[postmark]==8.1 # https://github.com/anymail/django-anymail +django-anymail[postmark]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Sendgrid' %} django-anymail[sendgrid]==8.1 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'SendinBlue' %} From f4a5b106a7bf8c0126636a637c175c9c8215c482 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 28 Jan 2021 09:24:38 -0800 Subject: [PATCH 026/146] Update django-anymail from 8.1 to 8.2 --- {{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 dc6a0a42e..148d20e48 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -32,7 +32,7 @@ django-anymail[mandrill]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Postmark' %} django-anymail[postmark]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Sendgrid' %} -django-anymail[sendgrid]==8.1 # https://github.com/anymail/django-anymail +django-anymail[sendgrid]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'SendinBlue' %} django-anymail[sendinblue]==8.1 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'SparkPost' %} From 0059a87a85f585a2e105d4140ccebe294df79e89 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 28 Jan 2021 09:24:39 -0800 Subject: [PATCH 027/146] Update django-anymail from 8.1 to 8.2 --- {{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 148d20e48..c3dd39f25 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -34,7 +34,7 @@ django-anymail[postmark]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Sendgrid' %} django-anymail[sendgrid]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'SendinBlue' %} -django-anymail[sendinblue]==8.1 # https://github.com/anymail/django-anymail +django-anymail[sendinblue]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'SparkPost' %} django-anymail[sparkpost]==8.1 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Other SMTP' %} From b2613405b00fd8b34be6bafec09a86a9824409ac Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 28 Jan 2021 09:24:40 -0800 Subject: [PATCH 028/146] Update django-anymail from 8.1 to 8.2 --- {{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 c3dd39f25..d9be12802 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -36,7 +36,7 @@ django-anymail[sendgrid]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'SendinBlue' %} django-anymail[sendinblue]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'SparkPost' %} -django-anymail[sparkpost]==8.1 # https://github.com/anymail/django-anymail +django-anymail[sparkpost]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Other SMTP' %} django-anymail==8.1 # https://github.com/anymail/django-anymail {%- endif %} From f12fdbafafe229cfb14252794664873dd6c5beec Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 28 Jan 2021 09:24:41 -0800 Subject: [PATCH 029/146] Update django-anymail from 8.1 to 8.2 --- {{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 d9be12802..ef7f99644 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -38,5 +38,5 @@ django-anymail[sendinblue]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'SparkPost' %} django-anymail[sparkpost]==8.2 # https://github.com/anymail/django-anymail {%- elif cookiecutter.mail_service == 'Other SMTP' %} -django-anymail==8.1 # https://github.com/anymail/django-anymail +django-anymail==8.2 # https://github.com/anymail/django-anymail {%- endif %} From e546500bd0d3ea92a629695a2c95addc74e49d57 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 28 Jan 2021 09:24:44 -0800 Subject: [PATCH 030/146] Update pre-commit from 2.9.3 to 2.10.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 e5919ee37..163a83d76 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.9.3 # https://github.com/pre-commit/pre-commit +pre-commit==2.10.0 # https://github.com/pre-commit/pre-commit # Django # ------------------------------------------------------------------------------ From 518f179b13545b061ee235a88687303a75bc406e Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 29 Jan 2021 02:36:43 +0000 Subject: [PATCH 031/146] Update Changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a246a3eb..96d9b79e1 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-01-28] +### Updated +- Update pre-commit to 2.10.0 ([#3028](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3028)) +- Update django-anymail to 8.2 ([#3027](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3027)) +- Update tox to 3.21.3 ([#3026](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3026)) + ## [2021-01-26] ### Changed - Bump peter-evans/create-pull-request from v3.6.0 to v3.7.0 ([#3022](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3022)) From e0cf956fe2b63fff19710bc0c12a47e795598b2d Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Fri, 29 Jan 2021 17:55:10 +0530 Subject: [PATCH 032/146] Refactored users.forms to make the code more readeable --- .../users/forms.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py index 7d3a296bc..80cd97aed 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py @@ -1,6 +1,5 @@ from django.contrib.auth import forms as admin_forms from django.contrib.auth import get_user_model -from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ User = get_user_model() @@ -12,20 +11,9 @@ class UserChangeForm(admin_forms.UserChangeForm): class UserCreationForm(admin_forms.UserCreationForm): - - error_message = admin_forms.UserCreationForm.error_messages.update( - {"duplicate_username": _("This username has already been taken.")} - ) - class Meta(admin_forms.UserCreationForm.Meta): model = User - def clean_username(self): - username = self.cleaned_data["username"] - - try: - User.objects.get(username=username) - except User.DoesNotExist: - return username - - raise ValidationError(self.error_messages["duplicate_username"]) + error_messages = { + "username": {"unique": _("This username has already been taken.")} + } From 0a241a8f75dfee56c0af5b7d8c7eea2f071b8ff3 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Fri, 29 Jan 2021 22:16:11 +0530 Subject: [PATCH 033/146] Updated test_forms.py to not check whether UserCreationForm has a clean_username() method --- .../{{cookiecutter.project_slug}}/users/tests/test_forms.py | 1 - 1 file changed, 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py index dfa5da52e..3b4a1210c 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py @@ -20,7 +20,6 @@ class TestUserCreationForm: ) assert form.is_valid() - assert form.clean_username() == proto_user.username # Creating a user. form.save() From e8996ef281ada2dab4188f2eff1435d2a694f50c Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Sat, 30 Jan 2021 11:41:16 +0530 Subject: [PATCH 034/146] Updated the test_clean_username test to also test for the custom validation message raised in case username already exists in the db --- .../{{cookiecutter.project_slug}}/users/tests/test_forms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py index 3b4a1210c..437829b25 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py @@ -1,4 +1,5 @@ import pytest +from django.utils.translation import ugettext_lazy as _ from {{ cookiecutter.project_slug }}.users.forms import UserCreationForm from {{ cookiecutter.project_slug }}.users.tests.factories import UserFactory @@ -37,3 +38,4 @@ class TestUserCreationForm: assert not form.is_valid() assert len(form.errors) == 1 assert "username" in form.errors + assert form.errors["username"][0] == _("This username has already been taken.") From b980db9f6252ba8a1d6727512d3cd1a40a3ef3cb Mon Sep 17 00:00:00 2001 From: PJ Hoberman Date: Sat, 30 Jan 2021 13:55:06 -0700 Subject: [PATCH 035/146] Adding local celery instructions to developing-locally --- docs/developing-locally.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/developing-locally.rst b/docs/developing-locally.rst index 2b7806ce4..264fd849d 100644 --- a/docs/developing-locally.rst +++ b/docs/developing-locally.rst @@ -143,6 +143,10 @@ when developing locally. If you have the appropriate setup on your local machine in ``config/settings/local.py``:: CELERY_TASK_ALWAYS_EAGER = False + +To run Celery locally, make sure redis-server is installed (instructions are available at https://redis.io/topics/quickstart), run the server in one terminal with `redis-server`, and then start celery in another terminal with the following command:: + + celery -A config.celery_app worker --loglevel=info Sass Compilation & Live Reloading From ba97025971b5f7ecd3b8b094b307f0bbea234efe Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 31 Jan 2021 05:43:22 -0800 Subject: [PATCH 036/146] Update django-crispy-forms from 1.10.0 to 1.11.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 a035aeed3..76efc0e9e 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -33,7 +33,7 @@ django==3.0.11 # pyup: < 3.1 # 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.10.0 # https://github.com/django-crispy-forms/django-crispy-forms +django-crispy-forms==1.11.0 # 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 ae63c708093696de322353cb497917b34be17399 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 31 Jan 2021 18:04:27 +0000 Subject: [PATCH 037/146] 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 8853e76e7..7a684f38f 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1067,5 +1067,10 @@ "name": "vascop", "github_login": "vascop", "twitter_username": "" + }, + { + "name": "PJ Hoberman", + "github_login": "pjhoberman", + "twitter_username": "" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 818b6cdd7..ca43cd64c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1223,6 +1223,13 @@ Listed in alphabetical order. + + PJ Hoberman + + pjhoberman + + + Raony GuimarĂ£es CorrĂªa From 958de4814eb6e2478a6a9464bcdcdf56055d15e3 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sun, 31 Jan 2021 18:11:23 +0000 Subject: [PATCH 038/146] Update dependabot.yml --- .github/dependabot.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5ee5d0a04..f0b70dd0e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,3 +8,5 @@ updates: directory: "/" schedule: interval: "daily" + labels: + - "update" From 7c68e12bcae78b9ea03724dda4e5afb987d9dd23 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 1 Feb 2021 02:37:18 +0000 Subject: [PATCH 039/146] Update Changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96d9b79e1..3fa3ae633 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-01-31] +### Changed +- Adding local celery instructions to developing-locally ([#3031](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3031)) +### Updated +- Update django-crispy-forms to 1.11.0 ([#3032](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3032)) + ## [2021-01-28] ### Updated - Update pre-commit to 2.10.0 ([#3028](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3028)) From ffffd6d14881f79a6dcc8c6e2d41141a88a6771f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 31 Jan 2021 18:37:25 -0800 Subject: [PATCH 040/146] Update jinja2 from 2.11.2 to 2.11.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 6f389476f..80b930c8f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,4 +20,4 @@ pyyaml==5.4.1 # Scripting # ------------------------------------------------------------------------------ PyGithub==1.54.1 -jinja2==2.11.2 +jinja2==2.11.3 From 086dae7ecaf4077ff81b8162f2843ccfa6791aa1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Feb 2021 07:19:27 +0000 Subject: [PATCH 041/146] Bump peter-evans/create-pull-request from v3.7.0 to v3.8.0 Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from v3.7.0 to v3.8.0. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v3.7.0...5e9d0ee9ea5ccf865a52a571cba827e4b52a1aff) Signed-off-by: dependabot[bot] --- .github/workflows/pre-commit-autoupdate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml index a0ad17ab0..ca2ecdd59 100644 --- a/.github/workflows/pre-commit-autoupdate.yml +++ b/.github/workflows/pre-commit-autoupdate.yml @@ -26,7 +26,7 @@ jobs: run: pre-commit autoupdate - name: Create Pull Request - uses: peter-evans/create-pull-request@v3.7.0 + uses: peter-evans/create-pull-request@v3.8.0 with: token: ${{ secrets.GITHUB_TOKEN }} branch: update/pre-commit-autoupdate From d442074ce33d7164b8563bb3c32b7df8b8b06129 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 1 Feb 2021 01:49:28 -0800 Subject: [PATCH 042/146] Update pytz from 2020.5 to 2021.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 76efc0e9e..b2eaa48ea 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,4 +1,4 @@ -pytz==2020.5 # https://github.com/stub42/pytz +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 {%- if cookiecutter.use_compressor == "y" %} From fc01e870bd53d1ab903f99b7fd842054910a8090 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 2 Feb 2021 02:38:04 +0000 Subject: [PATCH 043/146] Update Changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fa3ae633..a0abb1a45 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-01] +### Updated +- Update pytz to 2021.1 ([#3035](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3035)) +- Update jinja2 to 2.11.3 ([#3033](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3033)) +- Bump peter-evans/create-pull-request from v3.7.0 to v3.8.0 ([#3034](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3034)) + ## [2021-01-31] ### Changed - Adding local celery instructions to developing-locally ([#3031](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3031)) From c5750920164e11b840ef55db9f6720f4ee663a39 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 1 Feb 2021 18:38:12 -0800 Subject: [PATCH 044/146] Update django from 3.0.11 to 3.0.12 --- {{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 b2eaa48ea..a0e98dab1 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -29,7 +29,7 @@ uvicorn[standard]==0.13.3 # https://github.com/encode/uvicorn # Django # ------------------------------------------------------------------------------ -django==3.0.11 # pyup: < 3.1 # https://www.djangoproject.com/ +django==3.0.12 # pyup: < 3.1 # 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 fc8e2ea8a237b5a4badc2b1226194481cbca39ac Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Thu, 4 Feb 2021 15:28:08 +0530 Subject: [PATCH 045/146] Removed unnecessary test for username case sensitivity since django usernames are case sensitive by default. Also made the redirecting to the login url more dynamic by fetching the defined login_url from settings --- .../users/tests/test_views.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py index c2fe8b519..9e6bbcbfc 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py @@ -1,10 +1,12 @@ import pytest +from django.conf import settings from django.contrib import messages from django.contrib.auth.models import AnonymousUser from django.contrib.messages.middleware import MessageMiddleware from django.contrib.sessions.middleware import SessionMiddleware from django.http.response import Http404 from django.test import RequestFactory +from django.urls import reverse from {{ cookiecutter.project_slug }}.users.forms import UserChangeForm from {{ cookiecutter.project_slug }}.users.models import User @@ -90,13 +92,7 @@ class TestUserDetailView: request.user = AnonymousUser() response = user_detail_view(request, username=user.username) + login_url = reverse(settings.LOGIN_URL) assert response.status_code == 302 - assert response.url == "/accounts/login/?next=/fake-url/" - - def test_case_sensitivity(self, rf: RequestFactory): - request = rf.get("/fake-url/") - request.user = UserFactory(username="UserName") - - with pytest.raises(Http404): - user_detail_view(request, username="username") + assert response.url == f"{login_url}?next=/fake-url/" From 3cf7e74a7781f31314aa5f16a6be614057845f09 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Thu, 4 Feb 2021 15:54:26 +0530 Subject: [PATCH 046/146] Removed unused Http404 import. --- .../{{cookiecutter.project_slug}}/users/tests/test_views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py index 9e6bbcbfc..a9349bf3a 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py @@ -4,7 +4,6 @@ from django.contrib import messages from django.contrib.auth.models import AnonymousUser from django.contrib.messages.middleware import MessageMiddleware from django.contrib.sessions.middleware import SessionMiddleware -from django.http.response import Http404 from django.test import RequestFactory from django.urls import reverse From 002b3eaf4100c02d9045f5953157754699e60777 Mon Sep 17 00:00:00 2001 From: areski Date: Thu, 4 Feb 2021 16:52:45 +0100 Subject: [PATCH 047/146] Update Django 3.0.11 to 3.1.6 --- tests/test_docker.sh | 2 +- .../requirements/base.txt | 2 +- .../0004_alter_options_ordering_domain.py | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0004_alter_options_ordering_domain.py diff --git a/tests/test_docker.sh b/tests/test_docker.sh index 740f8fc22..f6df6b8ab 100755 --- a/tests/test_docker.sh +++ b/tests/test_docker.sh @@ -30,4 +30,4 @@ docker-compose -f local.yml run django pytest docker-compose -f local.yml run django python manage.py makemigrations --dry-run --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; } # Test support for translations -docker-compose -f local.yml run django python manage.py makemessages +docker-compose -f local.yml run django python manage.py makemessages --all diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index b2eaa48ea..1bb928178 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -29,7 +29,7 @@ uvicorn[standard]==0.13.3 # https://github.com/encode/uvicorn # Django # ------------------------------------------------------------------------------ -django==3.0.11 # pyup: < 3.1 # https://www.djangoproject.com/ +django==3.1.6 # pyup: < 3.1 # 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 diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0004_alter_options_ordering_domain.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0004_alter_options_ordering_domain.py new file mode 100644 index 000000000..ffc88bf5c --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0004_alter_options_ordering_domain.py @@ -0,0 +1,17 @@ +# Generated by Django 3.1.6 on 2021-02-04 14:49 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('sites', '0003_set_site_domain_and_name'), + ] + + operations = [ + migrations.AlterModelOptions( + name='site', + options={'ordering': ['domain'], 'verbose_name': 'site', 'verbose_name_plural': 'sites'}, + ), + ] From b2fa8b1b182f6b456e10870739652ec6b3045a45 Mon Sep 17 00:00:00 2001 From: areski Date: Thu, 4 Feb 2021 19:07:31 +0100 Subject: [PATCH 048/146] Update Readme for support Django 3.1 --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index dbc510a47..ae8699503 100644 --- a/README.rst +++ b/README.rst @@ -40,7 +40,7 @@ production-ready Django projects quickly. Features --------- -* For Django 3.0 +* For Django 3.1 * Works with Python 3.8 * Renders Django projects with 100% starting test coverage * Twitter Bootstrap_ v4 (`maintained Foundation fork`_ also available) From 39033fa8abb1c9cbb5895c498c5c829f35e82850 Mon Sep 17 00:00:00 2001 From: areski Date: Thu, 4 Feb 2021 19:09:09 +0100 Subject: [PATCH 049/146] Fix pyup for Django 3.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 1bb928178..3efa6170d 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -29,7 +29,7 @@ uvicorn[standard]==0.13.3 # https://github.com/encode/uvicorn # Django # ------------------------------------------------------------------------------ -django==3.1.6 # pyup: < 3.1 # https://www.djangoproject.com/ +django==3.1.6 # 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 47768d495f928196da015cd22c4c9c0cdfd1c429 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Fri, 5 Feb 2021 09:47:06 +0530 Subject: [PATCH 050/146] Refactored test_views to test only the required characteristics of the UserCreationForm. --- .../users/tests/test_forms.py | 38 +++++++++---------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py index 437829b25..617f2cbe5 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py @@ -1,37 +1,33 @@ +""" +Module for all Form Tests. +""" import pytest from django.utils.translation import ugettext_lazy as _ from {{ cookiecutter.project_slug }}.users.forms import UserCreationForm -from {{ cookiecutter.project_slug }}.users.tests.factories import UserFactory +from {{ cookiecutter.project_slug }}.users.models import User pytestmark = pytest.mark.django_db class TestUserCreationForm: - def test_clean_username(self): - # A user with proto_user params does not exist yet. - proto_user = UserFactory.build() + """ + Test class for all tests related to the UserCreationForm + """ + def test_username_validation_error_msg(self, user: User): + """ + Tests UserCreation Form's unique validator functions correctly by testing: + 1) Only 1 error is raised by the UserCreation Form + 2) The desired error message is raised + """ - form = UserCreationForm( - { - "username": proto_user.username, - "password1": proto_user._password, - "password2": proto_user._password, - } - ) - - assert form.is_valid() - - # Creating a user. - form.save() - - # The user with proto_user params already exists, + # The user already exists, # hence cannot be created. form = UserCreationForm( { - "username": proto_user.username, - "password1": proto_user._password, - "password2": proto_user._password, + "username": user.username, + "password1": user.password, + "password2": user.password, } ) From 352232f61706c22a1184094fe79798eef174baa3 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Fri, 5 Feb 2021 09:55:30 +0530 Subject: [PATCH 051/146] Fixed Formatting Issues. --- .../{{cookiecutter.project_slug}}/users/tests/test_forms.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py index 617f2cbe5..66118f493 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py @@ -14,11 +14,13 @@ class TestUserCreationForm: """ Test class for all tests related to the UserCreationForm """ + def test_username_validation_error_msg(self, user: User): """ Tests UserCreation Form's unique validator functions correctly by testing: - 1) Only 1 error is raised by the UserCreation Form - 2) The desired error message is raised + 1) A new user with an existing username cannot be added. + 2) Only 1 error is raised by the UserCreation Form + 3) The desired error message is raised """ # The user already exists, From 9d3d423221914da193f8a3f43cbc9f0d1a6c3ddc Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 6 Feb 2021 16:56:50 +0000 Subject: [PATCH 052/146] Bump template version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c72ba1c9d..e6e863850 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.0.11" +version = "3.0.12" if sys.argv[-1] == "tag": os.system(f'git tag -a {version} -m "version {version}"') From 06c54c9312b270c3cc88fd87da03351260dad053 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 6 Feb 2021 08:59:33 -0800 Subject: [PATCH 053/146] Update tox from 3.21.3 to 3.21.4 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 80b930c8f..d7e3c5b95 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8-isort==4.0.0 # Testing # ------------------------------------------------------------------------------ -tox==3.21.3 +tox==3.21.4 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 e853e50fb727a344fb7768c6bcd0433cbd7a76fb Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 7 Feb 2021 02:22:26 +0000 Subject: [PATCH 054/146] Update Changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0abb1a45..86d0cfd5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## [2021-02-06] +### Changed +- Removed Redundant test_case_sensitivity() and made test_not_authenticated() get the LOGIN_URL dynamically. ([#3041](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3041)) +- Refactored users.forms to make the code more readeable ([#3029](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3029)) +- Update django to 3.0.12 ([#3037](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3037)) +### Updated +- Update tox to 3.21.4 ([#3044](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3044)) + ## [2021-02-01] ### Updated - Update pytz to 2021.1 ([#3035](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3035)) From 416e052de22dcdee225b55669dc61d8a3ed1e2fb Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 6 Feb 2021 20:36:09 -0800 Subject: [PATCH 055/146] Update pre-commit from 2.10.0 to 2.10.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 163a83d76..62aa17ec0 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.0 # https://github.com/pre-commit/pre-commit +pre-commit==2.10.1 # https://github.com/pre-commit/pre-commit # Django # ------------------------------------------------------------------------------ From 10a4f4e4b8276aeffcf47f71705cc0f3b0934f02 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Feb 2021 06:30:51 +0000 Subject: [PATCH 056/146] Bump peter-evans/create-pull-request from v3.8.0 to v3.8.1 Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from v3.8.0 to v3.8.1. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v3.8.0...34371f09e5a05dadd212d0bc451d4c1fa456c646) Signed-off-by: dependabot[bot] --- .github/workflows/pre-commit-autoupdate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml index ca2ecdd59..188e96ac6 100644 --- a/.github/workflows/pre-commit-autoupdate.yml +++ b/.github/workflows/pre-commit-autoupdate.yml @@ -26,7 +26,7 @@ jobs: run: pre-commit autoupdate - name: Create Pull Request - uses: peter-evans/create-pull-request@v3.8.0 + uses: peter-evans/create-pull-request@v3.8.1 with: token: ${{ secrets.GITHUB_TOKEN }} branch: update/pre-commit-autoupdate From 073625445bdab864f0dadeeedb1e2fb233396bc9 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 8 Feb 2021 07:23:24 -0800 Subject: [PATCH 057/146] Update django-extensions from 3.1.0 to 3.1.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 163a83d76..88d7419f8 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -40,6 +40,6 @@ pre-commit==2.10.0 # 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.0 # https://github.com/django-extensions/django-extensions +django-extensions==3.1.1 # 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 8473717a910d3e1bf82e463d21962c12bac07a60 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 9 Feb 2021 02:21:45 +0000 Subject: [PATCH 058/146] Update Changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86d0cfd5c..6c1c32237 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-02-08] +### Updated +- Update django-extensions to 3.1.1 ([#3047](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3047)) +- Bump peter-evans/create-pull-request from v3.8.0 to v3.8.1 ([#3046](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3046)) + ## [2021-02-06] ### Changed - Removed Redundant test_case_sensitivity() and made test_not_authenticated() get the LOGIN_URL dynamically. ([#3041](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3041)) From 9efa93a7e0b406ed56a19f6856fb5fea81fffe38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Feb 2021 05:51:17 +0000 Subject: [PATCH 059/146] Bump peter-evans/create-pull-request from v3.8.1 to v3.8.2 Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from v3.8.1 to v3.8.2. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v3.8.1...052fc72b4198ba9fbc81b818c6e1859f747d49a8) Signed-off-by: dependabot[bot] --- .github/workflows/pre-commit-autoupdate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml index 188e96ac6..1c0c0b769 100644 --- a/.github/workflows/pre-commit-autoupdate.yml +++ b/.github/workflows/pre-commit-autoupdate.yml @@ -26,7 +26,7 @@ jobs: run: pre-commit autoupdate - name: Create Pull Request - uses: peter-evans/create-pull-request@v3.8.1 + uses: peter-evans/create-pull-request@v3.8.2 with: token: ${{ secrets.GITHUB_TOKEN }} branch: update/pre-commit-autoupdate From 84a6de2d75b265263b5610cf4d66348dc68041da Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 11 Feb 2021 02:21:56 +0000 Subject: [PATCH 060/146] Update Changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c1c32237..dd79da4bb 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-10] +### Updated +- Bump peter-evans/create-pull-request from v3.8.1 to v3.8.2 ([#3049](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3049)) + ## [2021-02-08] ### Updated - Update django-extensions to 3.1.1 ([#3047](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3047)) From ae151f04a2b9db0791b077b48d42baaf6f318c01 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 11 Feb 2021 23:54:12 -0800 Subject: [PATCH 061/146] Update sentry-sdk from 0.19.5 to 0.20.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 ef7f99644..9f1ea9691 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.19.5 # https://github.com/getsentry/sentry-python +sentry-sdk==0.20.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 8d87b194fc4b6fabcbd4c119174dd43c5793c8a3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 13 Feb 2021 02:21:49 +0000 Subject: [PATCH 062/146] Update Changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd79da4bb..182ce5eb6 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-02-12] +### Updated +- Update pre-commit to 2.10.1 ([#3045](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3045)) +- Update sentry-sdk to 0.20.0 ([#3051](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3051)) + ## [2021-02-10] ### Updated - Bump peter-evans/create-pull-request from v3.8.1 to v3.8.2 ([#3049](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3049)) From 179ba90299592f0437fe3b4a356f391248a57595 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 13 Feb 2021 00:19:41 -0800 Subject: [PATCH 063/146] Update sentry-sdk from 0.20.0 to 0.20.1 --- {{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 9f1ea9691..83f3ef9f7 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.0 # https://github.com/getsentry/sentry-python +sentry-sdk==0.20.1 # 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 027c18fb87610d9064e96ce8f619543cf0229bfb Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 14 Feb 2021 02:22:50 +0000 Subject: [PATCH 064/146] Update Changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 182ce5eb6..6cba732c6 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-13] +### Updated +- Update sentry-sdk to 0.20.1 ([#3052](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3052)) + ## [2021-02-12] ### Updated - Update pre-commit to 2.10.1 ([#3045](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3045)) From 583f8c668807e1f88bae57173bad839af87d488d Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 14 Feb 2021 15:08:48 -0800 Subject: [PATCH 065/146] Update sphinx from 3.4.3 to 3.5.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 7ef1d5097..39d6a9fda 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.4.3 # https://github.com/sphinx-doc/sphinx +sphinx==3.5.0 # https://github.com/sphinx-doc/sphinx sphinx-autobuild==2020.9.1 # https://github.com/GaretJax/sphinx-autobuild # Code quality From 3795bc04d039eb5e3e251c3be2bc190f2f4f697f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 16 Feb 2021 06:27:45 -0800 Subject: [PATCH 066/146] Update sentry-sdk from 0.20.1 to 0.20.2 --- {{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 83f3ef9f7..66d7fca42 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.1 # https://github.com/getsentry/sentry-python +sentry-sdk==0.20.2 # 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 17499a12c9216d1db907305ef30f58970cd0932e Mon Sep 17 00:00:00 2001 From: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Date: Tue, 16 Feb 2021 18:33:27 -0500 Subject: [PATCH 067/146] Remove email from User API --- .../{{cookiecutter.project_slug}}/users/api/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py index 8bd39d30e..b5ccabba1 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py @@ -7,7 +7,7 @@ User = get_user_model() class UserSerializer(serializers.ModelSerializer): class Meta: model = User - fields = ["username", "email", "name", "url"] + fields = ["username", "name", "url"] extra_kwargs = { "url": {"view_name": "api:user-detail", "lookup_field": "username"} From 8aeee881bb32935718e767114256179f9c9bf216 Mon Sep 17 00:00:00 2001 From: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Date: Tue, 16 Feb 2021 18:35:47 -0500 Subject: [PATCH 068/146] Remove email from User API Test --- .../{{cookiecutter.project_slug}}/users/tests/test_drf_views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py index 60944ad3b..924573089 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_drf_views.py @@ -28,7 +28,6 @@ class TestUserViewSet: assert response.data == { "username": user.username, - "email": user.email, "name": user.name, "url": f"http://testserver/api/users/{user.username}/", } From 55003e21a62c761910f64a4899842a986d5fdfba Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 17 Feb 2021 02:20:58 +0000 Subject: [PATCH 069/146] Update Changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cba732c6..c3a819341 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-02-16] +### Updated +- Update sentry-sdk to 0.20.2 ([#3054](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3054)) +- Update sphinx to 3.5.0 ([#3053](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3053)) + ## [2021-02-13] ### Updated - Update sentry-sdk to 0.20.1 ([#3052](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3052)) From 119a4d066010a3edb05e0a9e6a4ad927fa692c10 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 16 Feb 2021 18:21:04 -0800 Subject: [PATCH 070/146] Update sphinx from 3.5.0 to 3.5.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 39d6a9fda..02ff06aad 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.0 # https://github.com/sphinx-doc/sphinx +sphinx==3.5.1 # https://github.com/sphinx-doc/sphinx sphinx-autobuild==2020.9.1 # https://github.com/GaretJax/sphinx-autobuild # Code quality From c2db5077bb5620203008453791f3bb02c9becd4a Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 17 Feb 2021 04:27:17 -0800 Subject: [PATCH 071/146] Update tox from 3.21.4 to 3.22.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d7e3c5b95..cce198bf4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8-isort==4.0.0 # Testing # ------------------------------------------------------------------------------ -tox==3.21.4 +tox==3.22.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 81812fd8c297fb0164df3edcec519991a7f2c9cd Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 19 Feb 2021 06:29:09 -0800 Subject: [PATCH 072/146] Update sentry-sdk from 0.20.2 to 0.20.3 --- {{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 66d7fca42..0ce6fc10e 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.2 # https://github.com/getsentry/sentry-python +sentry-sdk==0.20.3 # 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 d67dbf9d362d1b00ab6a050444d4f9e6a68ff052 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 20 Feb 2021 00:58:50 -0800 Subject: [PATCH 073/146] Update django from 3.0.12 to 3.0.13 --- {{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 a0e98dab1..085972df1 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -29,7 +29,7 @@ uvicorn[standard]==0.13.3 # https://github.com/encode/uvicorn # Django # ------------------------------------------------------------------------------ -django==3.0.12 # pyup: < 3.1 # https://www.djangoproject.com/ +django==3.0.13 # pyup: < 3.1 # 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 5d138cc0f50a5d827a553fd4c2413e9e3923bcbe Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 20 Feb 2021 08:00:22 -0800 Subject: [PATCH 074/146] Update mypy from 0.800 to 0.812 --- {{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 39d6a9fda..c6293bde1 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -13,7 +13,7 @@ watchgod==0.6 # https://github.com/samuelcolvin/watchgod # Testing # ------------------------------------------------------------------------------ -mypy==0.800 # https://github.com/python/mypy +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-sugar==0.9.4 # https://github.com/Frozenball/pytest-sugar From bf4d502941e7ec626892d18ef2777e6d46ab653e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 21 Feb 2021 06:12:15 -0800 Subject: [PATCH 075/146] Update uvicorn from 0.13.3 to 0.13.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 a0e98dab1..132cd7cf7 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -24,7 +24,7 @@ flower==0.9.7 # https://github.com/mher/flower {%- endif %} {%- endif %} {%- if cookiecutter.use_async == 'y' %} -uvicorn[standard]==0.13.3 # https://github.com/encode/uvicorn +uvicorn[standard]==0.13.4 # https://github.com/encode/uvicorn {%- endif %} # Django From f97513d0ca601b4d1401da7f95c2dba867fd1e98 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 21 Feb 2021 06:12:17 -0800 Subject: [PATCH 076/146] Update django-crispy-forms from 1.11.0 to 1.11.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 a0e98dab1..34115932c 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -33,7 +33,7 @@ django==3.0.12 # pyup: < 3.1 # 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.0 # https://github.com/django-crispy-forms/django-crispy-forms +django-crispy-forms==1.11.1 # 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 86f79e08b2153c79b423d78247f3a0988b5a993b Mon Sep 17 00:00:00 2001 From: areski Date: Sun, 21 Feb 2021 17:55:05 +0100 Subject: [PATCH 077/146] Update Django to 3.1.7 --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- .../sites/migrations/0004_alter_options_ordering_domain.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 3efa6170d..7ded74df9 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -29,7 +29,7 @@ uvicorn[standard]==0.13.3 # https://github.com/encode/uvicorn # Django # ------------------------------------------------------------------------------ -django==3.1.6 # pyup: < 3.2 # https://www.djangoproject.com/ +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 diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0004_alter_options_ordering_domain.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0004_alter_options_ordering_domain.py index ffc88bf5c..00c9a74d3 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0004_alter_options_ordering_domain.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0004_alter_options_ordering_domain.py @@ -1,4 +1,4 @@ -# Generated by Django 3.1.6 on 2021-02-04 14:49 +# Generated by Django 3.1.7 on 2021-02-04 14:49 from django.db import migrations From 977e0333520af940fc7531559ce6af5c46d704c1 Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Sun, 21 Feb 2021 19:25:32 +0200 Subject: [PATCH 078/146] refactor: remove default cache settings in test.py It's LocMemCache by default, there is no need to specify this in test.py ```python django.core.cache.backends.locmem.LocMemCache ``` https://docs.djangoproject.com/en/dev/ref/settings/#caches --- {{cookiecutter.project_slug}}/config/settings/test.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/test.py b/{{cookiecutter.project_slug}}/config/settings/test.py index 667bb20d8..222597ad9 100644 --- a/{{cookiecutter.project_slug}}/config/settings/test.py +++ b/{{cookiecutter.project_slug}}/config/settings/test.py @@ -15,16 +15,6 @@ SECRET_KEY = env( # https://docs.djangoproject.com/en/dev/ref/settings/#test-runner TEST_RUNNER = "django.test.runner.DiscoverRunner" -# CACHES -# ------------------------------------------------------------------------------ -# https://docs.djangoproject.com/en/dev/ref/settings/#caches -CACHES = { - "default": { - "BACKEND": "django.core.cache.backends.locmem.LocMemCache", - "LOCATION": "", - } -} - # PASSWORDS # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#password-hashers From 4434df4d7b6dd5a4b22285d39b17b81a570e24f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Feb 2021 06:43:11 +0000 Subject: [PATCH 079/146] Bump stefanzweifel/git-auto-commit-action from v4.8.0 to v4.9.0 Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from v4.8.0 to v4.9.0. - [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.8.0...268ec0c24022281e267b095789643cf0db356bc6) 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 ea4ddf613..7cb2a1b80 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.8.0 + uses: stefanzweifel/git-auto-commit-action@v4.9.0 with: commit_message: Update Changelog file_pattern: CHANGELOG.md diff --git a/.github/workflows/update-contributors.yml b/.github/workflows/update-contributors.yml index f849484fc..4d9026b9f 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.8.0 + uses: stefanzweifel/git-auto-commit-action@v4.9.0 with: commit_message: Update Contributors file_pattern: CONTRIBUTORS.md .github/contributors.json From c8a4de1a385953a933efb757f70f5708aed6933b Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 22 Feb 2021 19:49:08 +0000 Subject: [PATCH 080/146] Bump template version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e6e863850..fb3a7cae7 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.0.12" +version = "3.0.13" if sys.argv[-1] == "tag": os.system(f'git tag -a {version} -m "version {version}"') From 748179bedc862f3967f359565ccbbc2c2233cf71 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 22 Feb 2021 20:26:42 +0000 Subject: [PATCH 081/146] 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 7a684f38f..5b5c575cf 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1072,5 +1072,10 @@ "name": "PJ Hoberman", "github_login": "pjhoberman", "twitter_username": "" + }, + { + "name": "lcd1232", + "github_login": "lcd1232", + "twitter_username": "" } ] \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index ca43cd64c..9a8e30190 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -978,6 +978,13 @@ Listed in alphabetical order. + + lcd1232 + + lcd1232 + + + Leo won From 1aa4c31b87d3a32fd791ee1a7053c4d08f845200 Mon Sep 17 00:00:00 2001 From: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Date: Mon, 22 Feb 2021 15:45:05 -0500 Subject: [PATCH 082/146] Change confusing CSRF 403 message Co-authored-by: Bruno Alla --- .../{{cookiecutter.project_slug}}/templates/403.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html index 49c82a9d7..31da98826 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html @@ -5,5 +5,5 @@ {% block content %}

Forbidden (403)

-

{% if exception %}{{ exception }}{% else %}CSRF verification failed. Request aborted.{% endif %}

+

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

{% endblock content %}{% endraw %} From 499b60ce7fb7ee38988ceca9db23bc1a93c9e76c Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 23 Feb 2021 02:24:37 +0000 Subject: [PATCH 083/146] Update Changelog --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3a819341..5838e06eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,22 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## [2021-02-22] +### Changed +- refactor: remove default cache settings in test.py ([#3064](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3064)) +- Update django to 3.0.13 ([#3060](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3060)) +### Fixed +- Fix missing Django Debug toolbar with node container ([#2865](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/2865)) +- Remove Email from User API ([#3055](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3055)) +### Updated +- Bump stefanzweifel/git-auto-commit-action from v4.8.0 to v4.9.0 ([#3065](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3065)) +- Update django-crispy-forms to 1.11.1 ([#3063](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3063)) +- Update uvicorn to 0.13.4 ([#3062](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3062)) +- Update mypy to 0.812 ([#3061](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3061)) +- Update sentry-sdk to 0.20.3 ([#3059](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3059)) +- Update tox to 3.22.0 ([#3057](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3057)) +- Update sphinx to 3.5.1 ([#3056](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3056)) + ## [2021-02-16] ### Updated - Update sentry-sdk to 0.20.2 ([#3054](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3054)) From a4f1acf17e952cb058676d75b3e0054ffee57643 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Tue, 23 Feb 2021 10:59:30 +0530 Subject: [PATCH 084/146] Updated the github action to run all pre-commit hooks on all files in the linter stage so that there is only 1 place that is used to maange all code quality tools. --- {{cookiecutter.project_slug}}/.github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index 57add2c04..3a6b0284c 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -16,7 +16,7 @@ on: jobs: - flake8: + linter: runs-on: ubuntu-latest steps: @@ -28,13 +28,13 @@ jobs: with: python-version: 3.8 - - name: Install flake8 + - name: Install flake8, flake8-isort, and black run: | python -m pip install --upgrade pip - pip install flake8 + pip install flake8 flake8-isort black - - name: Lint with flake8 - run: flake8 + - 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! pytest: From db636c8e3675132106ddc8ea99024a84ee594659 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Tue, 23 Feb 2021 11:11:03 +0530 Subject: [PATCH 085/146] Updated tests with the updated github stage names. --- tests/test_cookiecutter_generation.py | 12 ++++++------ .../.github/workflows/ci.yml | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index af6e4588b..a1dcf796d 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -234,7 +234,7 @@ def test_gitlab_invokes_flake8_and_pytest( ("y", "docker-compose -f local.yml exec -T django pytest"), ], ) -def test_github_invokes_flake8_and_pytest( +def test_github_invokes_linter_and_pytest( cookies, context, use_docker, expected_test_script ): context.update({"ci_tool": "Github", "use_docker": use_docker}) @@ -248,11 +248,11 @@ def test_github_invokes_flake8_and_pytest( with open(f"{result.project}/.github/workflows/ci.yml", "r") as github_yml: try: github_config = yaml.safe_load(github_yml) - flake8_present = False - for action_step in github_config["jobs"]["flake8"]["steps"]: - if action_step.get("run") == "flake8": - flake8_present = True - assert flake8_present + linter_present = False + for action_step in github_config["jobs"]["linter"]["steps"]: + if action_step.get("run") == "linter": + linter_present = True + assert linter_present expected_test_script_present = False for action_step in github_config["jobs"]["pytest"]["steps"]: diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index 3a6b0284c..a69b2c924 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -33,6 +33,9 @@ jobs: python -m pip install --upgrade pip pip install flake8 flake8-isort black + # Run all pre-commit hooks on all the files. + # Getting only staged files can be tricky in case a new PR is opened + # since the action is run on a branch in detached head state - name: Install and Run Pre-commit uses: pre-commit/action@v2.0.0 From fbc9b89e0d37d70b0e65db0f7b1d77f311989b50 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Tue, 23 Feb 2021 11:28:37 +0530 Subject: [PATCH 086/146] Updated tests with the updated github stage names. --- 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 a1dcf796d..c8514493f 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -250,7 +250,7 @@ def test_github_invokes_linter_and_pytest( github_config = yaml.safe_load(github_yml) linter_present = False for action_step in github_config["jobs"]["linter"]["steps"]: - if action_step.get("run") == "linter": + if action_step.get("uses", "NA").startswith("pre-commit"): linter_present = True assert linter_present From c988a6fbdc02eae7343749439ca01d81279dc7f2 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Tue, 23 Feb 2021 19:20:17 +0530 Subject: [PATCH 087/146] Removed the step for installing dependencies --- {{cookiecutter.project_slug}}/.github/workflows/ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index a69b2c924..378ee30b3 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -28,11 +28,6 @@ jobs: with: python-version: 3.8 - - name: Install flake8, flake8-isort, and black - run: | - python -m pip install --upgrade pip - pip install flake8 flake8-isort black - # Run all pre-commit hooks on all the files. # Getting only staged files can be tricky in case a new PR is opened # since the action is run on a branch in detached head state From 7a289de3e526565687e72e8d4e0b3bb3b50d9e81 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 23 Feb 2021 19:44:29 +0000 Subject: [PATCH 088/146] Bump version 3.0.13 -> 3.1.7 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fb3a7cae7..bc31d84a1 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.0.13" +version = "3.1.7" if sys.argv[-1] == "tag": os.system(f'git tag -a {version} -m "version {version}"') From ff98d8f517526f9211fcafb4eaf86d8f23ac7e1d Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 23 Feb 2021 20:34:41 +0000 Subject: [PATCH 089/146] Remove --use-feature=2020-resolver in pip commands They are now the default and cause a warning: WARNING: --use-feature=2020-resolver no longer has any effect, since it is now the default dependency resolver in pip. This will become an error in pip 21.0. --- {{cookiecutter.project_slug}}/compose/local/django/Dockerfile | 2 +- .../compose/production/django/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index c34f8ad40..25d70bf51 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -16,7 +16,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ COPY ./requirements /requirements # create python dependency wheels -RUN pip wheel --no-cache-dir --no-deps --use-feature=2020-resolver --wheel-dir /usr/src/app/wheels \ +RUN pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels \ -r /requirements/local.txt \ && rm -rf /requirements diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index a2f432ccc..f4e2b458b 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -30,7 +30,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ COPY ./requirements /requirements # create python dependency wheels -RUN pip wheel --no-cache-dir --no-deps --use-feature=2020-resolver --wheel-dir /usr/src/app/wheels \ +RUN pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels \ -r /requirements/production.txt \ && rm -rf /requirements From 483b636fcb74353baed3009be25ce7724bc5e644 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 23 Feb 2021 20:36:52 +0000 Subject: [PATCH 090/146] Only indent with spaces in django Dockerfile --- {{cookiecutter.project_slug}}/compose/local/django/Dockerfile | 2 +- .../compose/production/django/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index 25d70bf51..0fc7b9c16 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -66,7 +66,7 @@ COPY --from=python-build-stage /usr/src/app/wheels /wheels # use wheels to install python dependencies RUN pip install --no-cache /wheels/* \ - && rm -rf /wheels + && rm -rf /wheels WORKDIR /app diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index f4e2b458b..69b80aa00 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -85,7 +85,7 @@ COPY --from=python-build-stage /usr/src/app/wheels /wheels # use wheels to install python dependencies RUN pip install --no-cache /wheels/* \ - && rm -rf /wheels + && rm -rf /wheels {%- if cookiecutter.js_task_runner == 'Gulp' %} COPY --from=client-builder --chown=django:django /app /app From 4caad4a1297a555343e12a6e887b0cfe9b6e370d Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 24 Feb 2021 02:25:29 +0000 Subject: [PATCH 091/146] Update Changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5838e06eb..d0a4c8f2d 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 15453df8245ffd31b9aceaecb9970342b26f814a Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Wed, 24 Feb 2021 10:58:28 +0530 Subject: [PATCH 092/146] Updated the local and production dockerfiles with more repeatability and easier to update in mind. --- .../compose/local/django/Dockerfile | 85 ++++++++------- .../compose/production/django/Dockerfile | 101 ++++++++++-------- 2 files changed, 103 insertions(+), 83 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index 0fc7b9c16..bdcd87ba7 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -1,31 +1,57 @@ -# Python build stage -FROM python:3.8-slim-buster as python-build-stage -ENV PYTHONDONTWRITEBYTECODE 1 +ARG PYTHON_VERSION=3.8-slim-buster +# define an alias for the specfic python version used in this file. +FROM python:${PYTHON_VERSION} as python + +# Python build stage +FROM python as python-build-stage + +ARG BUILD_ENVIRONMENT=local + +# Install apt packages RUN apt-get update && apt-get install --no-install-recommends -y \ # dependencies for building Python packages build-essential \ + # psycopg2 dependencies + libpq-dev + +# Requirements are installed here to ensure they will be cached. +COPY ./requirements . + +# Create Python Dependency and Sub-Dependency Wheels. +RUN pip wheel --wheel-dir /usr/src/app/wheels \ + -r ${BUILD_ENVIRONMENT}.txt + + +# Python 'run' stage +FROM python as python-run-stage + +ARG BUILD_ENVIRONMENT=local +ARG APP_HOME=/app + +ENV PYTHONUNBUFFERED 1 +ENV PYTHONDONTWRITEBYTECODE 1 +ENV BUILD_ENV ${BUILD_ENVIRONMENT} + +WORKDIR ${APP_HOME} + +# Install required system dependencies +RUN apt-get update && apt-get install --no-install-recommends -y \ # psycopg2 dependencies libpq-dev \ + # Translations dependencies + gettext \ # cleaning up unused files && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ && rm -rf /var/lib/apt/lists/* +# All absolute dir copies ignore workdir instruction. All relative dir copies are wrt to the workdir instruction +# copy python dependency wheels from python-build-stage +COPY --from=python-build-stage /usr/src/app/wheels /wheels/ -# Requirements are installed here to ensure they will be cached. -COPY ./requirements /requirements - -# create python dependency wheels -RUN pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels \ - -r /requirements/local.txt \ - && rm -rf /requirements - - -# Python 'run' stage -FROM python:3.8-slim-buster as python-run-stage - -ENV PYTHONUNBUFFERED 1 -ENV PYTHONDONTWRITEBYTECODE 1 +# use wheels to install python dependencies +RUN pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* \ + && rm -rf /wheels/ COPY ./compose/production/django/entrypoint /entrypoint RUN sed -i 's/\r$//g' /entrypoint @@ -49,26 +75,7 @@ RUN sed -i 's/\r$//g' /start-flower RUN chmod +x /start-flower {% endif %} +# copy application code to WORKDIR +COPY . ${APP_HOME} -# installing required system dependencies -RUN apt-get update && apt-get install --no-install-recommends -y \ - # psycopg2 dependencies - libpq-dev \ - # Translations dependencies - gettext \ - # cleaning up unused files - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - && rm -rf /var/lib/apt/lists/* - - -# copy python dependency wheels from python-build-stage -COPY --from=python-build-stage /usr/src/app/wheels /wheels - -# use wheels to install python dependencies -RUN pip install --no-cache /wheels/* \ - && rm -rf /wheels - - -WORKDIR /app - -ENTRYPOINT ["/entrypoint"] +ENTRYPOINT ["/entrypoint"] \ No newline at end of file diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 69b80aa00..8fa6e202c 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -1,47 +1,75 @@ {% if cookiecutter.js_task_runner == 'Gulp' -%} FROM node:10-stretch-slim as client-builder -WORKDIR /app -COPY ./package.json /app +ARG APP_HOME=/app +WORKDIR ${APP_HOME} + +COPY ./package.json ${APP_HOME} RUN npm install && npm cache clean --force -COPY . /app +COPY . ${APP_HOME} RUN npm run build {%- endif %} +ARG PYTHON_VERSION=3.8-slim-buster + +# define an alias for the specfic python version used in this file. +FROM python:${PYTHON_VERSION} as python + # Python build stage -FROM python:3.8-slim-buster as python-build-stage - -ENV PYTHONDONTWRITEBYTECODE 1 -ARG BUILD_ENVIRONMENT +FROM python as python-build-stage +ARG BUILD_ENVIRONMENT=production +# Install apt packages RUN apt-get update && apt-get install --no-install-recommends -y \ # dependencies for building Python packages build-essential \ + # psycopg2 dependencies + libpq-dev + +# Requirements are installed here to ensure they will be cached. +COPY ./requirements . + +# Create Python Dependency and Sub-Dependency Wheels. +RUN pip wheel --wheel-dir /usr/src/app/wheels \ + -r ${BUILD_ENVIRONMENT}.txt + + +# Python 'run' stage +FROM python as python-run-stage + +ARG BUILD_ENVIRONMENT=production +ARG APP_HOME=/app + +ENV PYTHONUNBUFFERED 1 +ENV PYTHONDONTWRITEBYTECODE 1 +ENV BUILD_ENV ${BUILD_ENVIRONMENT} + +WORKDIR ${APP_HOME} + +RUN addgroup --system django \ + && adduser --system --ingroup django django + + +# Install required system dependencies +RUN apt-get update && apt-get install --no-install-recommends -y \ # psycopg2 dependencies libpq-dev \ + # Translations dependencies + gettext \ # cleaning up unused files && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ && rm -rf /var/lib/apt/lists/* +# All absolute dir copies ignore workdir instruction. All relative dir copies are wrt to the workdir instruction +# copy python dependency wheels from python-build-stage +COPY --from=python-build-stage /usr/src/app/wheels /wheels/ -# Requirements are installed here to ensure they will be cached. -COPY ./requirements /requirements +# use wheels to install python dependencies +RUN pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* \ + && rm -rf /wheels/ -# create python dependency wheels -RUN pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels \ - -r /requirements/production.txt \ - && rm -rf /requirements - -# Python 'run' stage -FROM python:3.8-slim-buster as python-run-stage - -ENV PYTHONDONTWRITEBYTECODE 1 -ENV PYTHONUNBUFFERED 1 - -RUN addgroup --system django \ - && adduser --system --ingroup django django COPY --chown=django:django ./compose/production/django/entrypoint /entrypoint RUN sed -i 's/\r$//g' /entrypoint @@ -69,32 +97,17 @@ RUN sed -i 's/\r$//g' /start-flower RUN chmod +x /start-flower {%- endif %} -# installing required system dependencies -RUN apt-get update && apt-get install --no-install-recommends -y \ - # psycopg2 dependencies - libpq-dev \ - # Translations dependencies - gettext \ - # cleaning up unused files - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - && rm -rf /var/lib/apt/lists/* - - -# copy python dependency wheels from python-build-stage -COPY --from=python-build-stage /usr/src/app/wheels /wheels - -# use wheels to install python dependencies -RUN pip install --no-cache /wheels/* \ - && rm -rf /wheels +# copy application code to WORKDIR {%- if cookiecutter.js_task_runner == 'Gulp' %} -COPY --from=client-builder --chown=django:django /app /app +COPY --from=client-builder --chown=django:django ${APP_HOME} ${APP_HOME} {% else %} -COPY --chown=django:django . /app +COPY --chown=django:django . ${APP_HOME} {%- endif %} +# make django owner of the WORKDIR directory as well. +RUN chown django:django ${APP_HOME} + USER django -WORKDIR /app - -ENTRYPOINT ["/entrypoint"] +ENTRYPOINT ["/entrypoint"] \ No newline at end of file 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 093/146] 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 7cb2a1b80..5c63532b3 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 4d9026b9f..64a899e44 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 2345c2c92d21b8274f0581864f0b656b9b147cca Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Wed, 24 Feb 2021 16:26:58 +0530 Subject: [PATCH 094/146] Update {{cookiecutter.project_slug}}/compose/production/django/Dockerfile Co-authored-by: Bruno Alla --- .../compose/production/django/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 8fa6e202c..4da817df3 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -68,7 +68,7 @@ COPY --from=python-build-stage /usr/src/app/wheels /wheels/ # use wheels to install python dependencies RUN pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* \ - && rm -rf /wheels/ + && rm -rf /wheels/ COPY --chown=django:django ./compose/production/django/entrypoint /entrypoint @@ -110,4 +110,4 @@ RUN chown django:django ${APP_HOME} USER django -ENTRYPOINT ["/entrypoint"] \ No newline at end of file +ENTRYPOINT ["/entrypoint"] From e0566e5b1eeb9c8e17ff66b9fd9a0529bcdf768c Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 25 Feb 2021 02:23:46 +0000 Subject: [PATCH 095/146] Update Changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0a4c8f2d..f3ca47755 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 096/146] 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 aab6d0a87..2623f4e39 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 2b077d424..c7b846c08 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 097/146] 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 6960b1d79..47bba1361 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 098/146] 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 71317e818..d5382a6d5 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 099/146] 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 378ee30b3..c8bda2174 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 100/146] 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 c8bda2174..c84d3eebd 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 101/146] 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 c84d3eebd..7799cf415 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 102/146] 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 7799cf415..9798e6c8d 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 103/146] 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 c8514493f..7e585ea40 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 104/146] 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 47bba1361..ec239bb46 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 105/146] Update Changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3ca47755..0b2a08777 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 106/146] 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 cce198bf4..a410f3132 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 107/146] Update Changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b2a08777..1a0e1b749 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 108/146] 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 2623f4e39..aab6d0a87 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 109/146] 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 5c63532b3..fa70824c0 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 64a899e44..5d5dd0eaa 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 110/146] Update Changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a0e1b749..150dd3909 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 111/146] 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 d5382a6d5..377f2d05f 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 112/146] 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 ec239bb46..ed3479fce 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 113/146] 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 a410f3132..54dbc229d 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 114/146] 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 ec239bb46..9b49a0b46 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 115/146] 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 5a5b58a63..fd4572f79 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 116/146] 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 000000000..fe6f21e46 --- /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 117/146] 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 54dbc229d..3b16db8d8 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 118/146] 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 49640cb26..a1e39ca50 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 119/146] 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 49640cb26..6fafe86de 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 120/146] 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 9b8535574..b6a7e5439 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 121/146] 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 377f2d05f..75479fdb3 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 122/146] Update Changelog --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 150dd3909..db8f052f3 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 123/146] 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 75479fdb3..69b11ce71 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 124/146] Update Changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db8f052f3..15c176dbb 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 125/146] 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 69b11ce71..1946b0750 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 126/146] Update Changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15c176dbb..d1479a28e 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 127/146] 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 0ce6fc10e..743cb3f9e 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 128/146] 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 60925b811..fcdfb7dd7 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 129/146] 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 fcdfb7dd7..c599f6b62 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 130/146] 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 1946b0750..96619498f 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 131/146] 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 b6a7e5439..fdce88d72 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 132/146] 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 b6a7e5439..fbe62a58f 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 133/146] 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 1946b0750..25d1802da 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 134/146] 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 b6a7e5439..dcbd76b93 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 135/146] 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 743cb3f9e..6e566eccf 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 136/146] 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 bc31d84a1..f8cfe29cd 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 137/146] 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 5b5c575cf..846375687 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 9a8e30190..ea8701879 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 138/146] 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 eae09dc78..c7938ecf6 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 139/146] 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 fd4572f79..df71ea618 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 a0955f076..dff52e75b 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 c831e0309..812fa0fa6 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 0becb2cbe..8679a0669 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 2aae422ce..b120f16a6 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 7b56063f3..cc183cd6c 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 f69908c2d..640d8b62c 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 bd0acfbd4..59928f829 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 e285f3498..6241ceede 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 93b61b134..3cccdb653 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 517934841..e09ebf6f8 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 31da98826..4c4745f7d 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 187c1fc9d..d98241858 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 122e0813e..481bb2d0b 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 fe9b68078..0713ff110 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 cd07bbabf..03c86724b 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 2b7e12789..055904ae9 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 eb45cf600..2a0722a1d 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 a71932225..247ca690a 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 baa8183c9..6659724e0 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 62bbbc138..7f2fbed07 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 b9869fb23..474b0f4a9 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 cf2129b1e..94ea2dfbe 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 671eb12c9..66ea9ba60 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 925b7aa23..7defcc86c 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 563a0b185..435ed073e 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 80490a2e1..7a1e29a4d 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 eca9b1568..08b937726 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 ccc8d9a1f..4394e9c67 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 f3078b68e..8eafcbedb 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 127068878..951b17dbe 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 94beff9c8..8968a3d4f 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 94beff9c8..8968a3d4f 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 47b611220..eed39ca3a 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 e9da0d48f..53e14a530 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 140/146] 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 919f31185..ef581a1c0 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 660eda34c..9cbb6c897 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 8d5ea091f..0c515935f 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 4a89dcb5a..9446b9304 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 141/146] 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 3b16db8d8..b4ae9467a 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 c7938ecf6..1f52d91b6 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 f6df6b8ab..001ef06d0 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 142/146] 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 206f8a019..56a08e8fc 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 143/146] 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 951b17dbe..c36794048 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 %} From 9c4f047886ce8c25d3df7d7023cb3a8692b581c7 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 7 Apr 2021 13:01:52 -0700 Subject: [PATCH 144/146] Update pre-commit from 2.10.1 to 2.12.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b4ae9467a..1e75dbced 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ black==20.8b1 isort==5.8.0 flake8==3.9.0 flake8-isort==4.0.0 -pre-commit==2.10.1 +pre-commit==2.12.0 # Testing # ------------------------------------------------------------------------------ From e6604f9a7d0211216c18f792a91a2366c3fac411 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 7 Apr 2021 21:12:36 +0100 Subject: [PATCH 145/146] Fix style --- {{cookiecutter.project_slug}}/compose/local/django/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index bdcd87ba7..f174bcefd 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -78,4 +78,4 @@ RUN chmod +x /start-flower # copy application code to WORKDIR COPY . ${APP_HOME} -ENTRYPOINT ["/entrypoint"] \ No newline at end of file +ENTRYPOINT ["/entrypoint"] From c08f6115b0b1721f726e2474aff8f754008659f8 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 8 Apr 2021 02:26:56 +0000 Subject: [PATCH 146/146] Update Changelog --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1479a28e..d9559b9f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,20 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## [2021-04-07] +### Changed +- Update django to 3.1.8 ([#3117](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3117)) +### Fixed +- Fix linting via pre-commit on Github CI ([#3077](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3077)) +- Fix gitlab-ci using duplicate key name for image ([#3112](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3112)) +### Updated +- Update sentry-sdk to 1.0.0 ([#3080](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3080)) +- Update gunicorn to 20.1.0 ([#3108](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3108)) +- Update pre-commit to 2.12.0 ([#3118](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3118)) +- Update django-extensions to 3.1.2 ([#3116](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3116)) +- Update pillow to 8.2.0 ([#3113](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3113)) +- Update pytest to 6.2.3 ([#3115](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3115)) + ## [2021-03-26] ### Updated - Update djangorestframework to 3.12.4 ([#3107](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3107))