diff --git a/.github/contributors.json b/.github/contributors.json index b9ea8b1a5..0a4f213c0 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1107,5 +1107,25 @@ "name": "Haseeb ur Rehman", "github_login": "professorhaseeb", "twitter_username": "professorhaseeb" + }, + { + "name": "Abdul Qoyyuum", + "github_login": "Qoyyuum", + "twitter_username": "Qoyyuum" + }, + { + "name": "mfosterw", + "github_login": "mfosterw", + "twitter_username": "" + }, + { + "name": "Keith Callenberg", + "github_login": "keithcallenberg", + "twitter_username": "" + }, + { + "name": "Mike97M", + "github_login": "Mike97M", + "twitter_username": "" } ] diff --git a/CHANGELOG.md b/CHANGELOG.md index 588c58ab7..e9a9cd24f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,27 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## [2021-07-30] +### Updated +- Auto-update pre-commit hooks ([#3283](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3283)) +- Update isort to 5.9.3 ([#3282](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3282)) + +## [2021-07-27] +### Changed +- Convert trans to translate in templates ([#3277](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3277)) +### Updated +- Update hiredis to 2.0.0 ([#3110](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3110)) +- Update mypy to 0.910 ([#3237](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3237)) +- Update whitenoise to 5.3.0 ([#3273](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3273)) +- Update tox to 3.24.0 ([#3269](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3269)) +- Update django-allauth to 0.45.0 ([#3267](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3267)) +- Update sentry-sdk to 1.3.0 ([#3262](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3262)) +- Update sphinx to 4.1.2 ([#3278](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3278)) +- Auto-update pre-commit hooks ([#3264](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3264)) +- Update isort to 5.9.2 ([#3279](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3279)) +- Update pillow to 8.3.1 ([#3259](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3259)) +- Update black to 21.7b0 ([#3272](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3272)) + ## [2021-07-12] ### Changed - Define REMAP_SIGTERM=SIGQUIT on Profile of Celery on Heroku ([#3263](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3263)) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index dc37c3375..77b548863 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -124,6 +124,13 @@ Listed in alphabetical order. + + Abdul Qoyyuum + + Qoyyuum + + Qoyyuum + Adam BogdaƂ @@ -950,6 +957,13 @@ Listed in alphabetical order. + + Keith Callenberg + + keithcallenberg + + + Keith Webber @@ -1167,6 +1181,13 @@ Listed in alphabetical order. + + mfosterw + + mfosterw + + + Michael Gecht @@ -1181,6 +1202,13 @@ Listed in alphabetical order. + + Mike97M + + Mike97M + + + Min ho Kim diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 0d582d484..858f89b88 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -18,10 +18,11 @@ Prerequisites * Docker; if you don't have it yet, follow the `installation instructions`_; * Docker Compose; refer to the official documentation for the `installation guide`_. +* Pre-commit; refer to the official documentation for the `installation guide`_. .. _`installation instructions`: https://docs.docker.com/install/#supported-platforms .. _`installation guide`: https://docs.docker.com/compose/install/ - +.. _`pre-commit`: https://pre-commit.com/#install Build the Stack --------------- @@ -32,6 +33,13 @@ This can take a while, especially the first time you run this particular command Generally, if you want to emulate production environment use ``production.yml`` instead. And this is true for any other actions you might need to perform: whenever a switch is required, just do it! +Before doing any git commit, `pre-commit`_ should be installed globally on your local machine, and then:: + + $ git init + $ pre-commit install + +Failing to do so will result with a bunch of CI and Linter errors that can be avoided with pre-commit. + Run the Stack ------------- diff --git a/docs/developing-locally.rst b/docs/developing-locally.rst index f33588668..83bc1342c 100644 --- a/docs/developing-locally.rst +++ b/docs/developing-locally.rst @@ -30,6 +30,7 @@ First things first. #. Install development requirements: :: + $ cd $ pip install -r requirements/local.txt $ git init # A git repo is required for pre-commit to install $ pre-commit install diff --git a/docs/docker-postgres-backups.rst b/docs/docker-postgres-backups.rst index 6ccb7cf1e..875d737eb 100644 --- a/docs/docker-postgres-backups.rst +++ b/docs/docker-postgres-backups.rst @@ -55,8 +55,11 @@ With a single backup file copied to ``.`` that would be :: $ docker cp 9c5c3f055843:/backups/backup_2018_03_13T09_05_07.sql.gz . -.. _`command`: https://docs.docker.com/engine/reference/commandline/cp/ +You can also get the container ID using ``docker-compose -f local.yml ps -q postgres`` so if you want to automate your backups, you don't have to check the container ID manually every time. Here is the full command :: + $ docker cp $(docker-compose -f local.yml ps -q postgres):/backups ./backups + +.. _`command`: https://docs.docker.com/engine/reference/commandline/cp/ Restoring from the Existing Backup ---------------------------------- diff --git a/requirements.txt b/requirements.txt index b48a5ab91..57541921e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,15 +4,15 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -black==21.6b0 -isort==5.9.1 +black==21.7b0 +isort==5.9.3 flake8==3.9.2 flake8-isort==4.0.0 -pre-commit==2.13.0 +pre-commit==2.14.0 # Testing # ------------------------------------------------------------------------------ -tox==3.23.1 +tox==3.24.1 pytest==6.2.4 pytest-cookies==0.6.1 pytest-instafail==0.4.2 diff --git a/setup.py b/setup.py index ddc9524d4..64e923aef 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.12" +version = "3.1.13" if sys.argv[-1] == "tag": os.system(f'git tag -a {version} -m "version {version}"') diff --git a/{{cookiecutter.project_slug}}/.editorconfig b/{{cookiecutter.project_slug}}/.editorconfig index 39c15f079..261407067 100644 --- a/{{cookiecutter.project_slug}}/.editorconfig +++ b/{{cookiecutter.project_slug}}/.editorconfig @@ -12,18 +12,6 @@ trim_trailing_whitespace = true indent_style = space indent_size = 4 -[*.py] -line_length = 88 -known_first_party = {{cookiecutter.project_slug}},config -multi_line_output = 3 -default_section = THIRDPARTY -recursive = true -skip = venv/ -skip_glob = **/migrations/*.py -include_trailing_comma = true -force_grid_wrap = 0 -use_parentheses = true - [*.{html,css,scss,json,yml}] indent_style = space indent_size = 2 diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index ac71019ab..5551169eb 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -11,12 +11,12 @@ repos: - id: check-yaml - repo: https://github.com/psf/black - rev: 21.6b0 + rev: 21.7b0 hooks: - id: black - repo: https://github.com/timothycrosley/isort - rev: 5.9.1 + rev: 5.9.3 hooks: - id: isort diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index a39de1bc3..3680b3904 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==5.0.2 # https://github.com/un33k/python-slugify -Pillow==8.2.0 # https://github.com/python-pillow/Pillow +Pillow==8.3.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 @@ -10,11 +10,11 @@ rcssmin==1.0.6 # https://github.com/ndparker/rcssmin {%- endif %} argon2-cffi==20.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} -whitenoise==5.2.0 # https://github.com/evansd/whitenoise +whitenoise==5.3.0 # https://github.com/evansd/whitenoise {%- endif %} redis==3.5.3 # https://github.com/andymccurdy/redis-py {%- if cookiecutter.use_docker == "y" or cookiecutter.windows == "n" %} -hiredis==1.1.0 # https://github.com/redis/hiredis-py +hiredis==2.0.0 # https://github.com/redis/hiredis-py {%- endif %} {%- if cookiecutter.use_celery == "y" %} celery==4.4.6 # pyup: < 5.0,!=4.4.7 # https://github.com/celery/celery @@ -32,7 +32,7 @@ uvicorn[standard]==0.14.0 # https://github.com/encode/uvicorn django==3.1.13 # 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-allauth==0.45.0 # https://github.com/pennersr/django-allauth django-crispy-forms==1.12.0 # https://github.com/django-crispy-forms/django-crispy-forms {%- if cookiecutter.use_compressor == "y" %} django-compressor==2.4.1 # https://github.com/django-compressor/django-compressor diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index e77e15b99..9eab142db 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -13,14 +13,14 @@ watchgod==0.7 # https://github.com/samuelcolvin/watchgod # Testing # ------------------------------------------------------------------------------ -mypy==0.902 # https://github.com/python/mypy +mypy==0.910 # https://github.com/python/mypy django-stubs==1.8.0 # https://github.com/typeddjango/django-stubs pytest==6.2.4 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.4 # https://github.com/Frozenball/pytest-sugar # Documentation # ------------------------------------------------------------------------------ -sphinx==4.0.2 # https://github.com/sphinx-doc/sphinx +sphinx==4.1.2 # https://github.com/sphinx-doc/sphinx sphinx-autobuild==2021.3.14 # https://github.com/GaretJax/sphinx-autobuild # Code quality @@ -28,12 +28,12 @@ sphinx-autobuild==2021.3.14 # https://github.com/GaretJax/sphinx-autobuild flake8==3.9.2 # 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==21.6b0 # https://github.com/psf/black +black==21.7b0 # https://github.com/psf/black pylint-django==2.4.4 # 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.13.0 # https://github.com/pre-commit/pre-commit +pre-commit==2.14.0 # https://github.com/pre-commit/pre-commit # Django # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 06d33ae05..61ca0b970 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,10 +8,10 @@ psycopg2==2.9.1 # https://github.com/psycopg/psycopg2 Collectfast==2.2.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==1.1.0 # https://github.com/getsentry/sentry-python +sentry-sdk==1.3.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 +hiredis==2.0.0 # https://github.com/redis/hiredis-py {%- endif %} # Django diff --git a/{{cookiecutter.project_slug}}/setup.cfg b/{{cookiecutter.project_slug}}/setup.cfg index c3ce2a0ef..d0ba6387c 100644 --- a/{{cookiecutter.project_slug}}/setup.cfg +++ b/{{cookiecutter.project_slug}}/setup.cfg @@ -6,6 +6,17 @@ exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules,venv max-line-length = 120 exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules,venv +[isort] +line_length = 88 +known_first_party = {{cookiecutter.project_slug}},config +multi_line_output = 3 +default_section = THIRDPARTY +skip = venv/ +skip_glob = **/migrations/*.py +include_trailing_comma = true +force_grid_wrap = 0 +use_parentheses = true + [mypy] python_version = 3.9 check_untyped_defs = True 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 0713ff110..ab910820e 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 @@ -2,11 +2,11 @@ {% load i18n %} -{% block head_title %}{% trans "Account Inactive" %}{% endblock %} +{% block head_title %}{% translate "Account Inactive" %}{% endblock %} {% block inner %} -

{% trans "Account Inactive" %}

+

{% translate "Account Inactive" %}

-

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

+

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

{% endblock %} {%- 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 5c9406f3f..07b5789e6 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html @@ -4,13 +4,13 @@ {% load i18n %} {% load crispy_forms_tags %} -{% block head_title %}{% trans "Account" %}{% endblock %} +{% block head_title %}{% translate "Account" %}{% endblock %} {% block inner %} -

{% trans "E-mail Addresses" %}

+

{% translate "E-mail Addresses" %}

{% if user.emailaddress_set.all %} -

{% trans 'The following e-mail addresses are associated with your account:' %}

+

{% translate 'The following e-mail addresses are associated with your account:' %}

{% csrf_token %} @@ -24,36 +24,36 @@ {{ emailaddress.email }} {% if emailaddress.verified %} - {% trans "Verified" %} + {% translate "Verified" %} {% else %} - {% trans "Unverified" %} + {% translate "Unverified" %} {% endif %} - {% if emailaddress.primary %}{% trans "Primary" %}{% endif %} + {% if emailaddress.primary %}{% translate "Primary" %}{% endif %} {% endfor %}
- - - + + +
{% else %} -

{% trans 'Warning:'%} {% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}

+

{% translate 'Warning:'%} {% translate "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}

{% endif %} -

{% trans "Add E-mail Address" %}

+

{% translate "Add E-mail Address" %}

{% csrf_token %} {{ form|crispy }} - +
{% endblock %} @@ -63,7 +63,7 @@ {{ block.super }}