Merge branch 'master' into djangoissuer

This commit is contained in:
Bruno Alla 2021-11-08 22:49:57 +00:00
commit 5672b3f4c7
42 changed files with 323 additions and 145 deletions

View File

@ -1107,5 +1107,35 @@
"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": ""
},
{
"name": "Charlie Macfarlane Brodie",
"github_login": "tannart",
"twitter_username": ""
},
{
"name": "Floyd Hightower",
"github_login": "fhightower",
"twitter_username": ""
}
]

View File

@ -26,7 +26,7 @@ jobs:
run: pre-commit autoupdate
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3.10.0
uses: peter-evans/create-pull-request@v3.10.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pre-commit-autoupdate

View File

@ -3,6 +3,80 @@ All enhancements and patches to Cookiecutter Django will be documented in this f
<!-- GENERATOR_PLACEHOLDER -->
## [2021-09-06]
### Changed
- Update Celery to v5 ([#3280](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3280))
## [2021-09-05]
### Updated
- Update django-environ to 0.6.0 ([#3314](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3314))
## [2021-09-03]
### Changed
- Update available postgres versions ([#3297](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3297))
### Updated
- Update pre-commit to 2.15.0 ([#3313](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3313))
- Auto-update pre-commit hooks ([#3307](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3307))
- Update pillow to 8.3.2 ([#3312](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3312))
- Update django-environ to 0.5.0 ([#3311](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3311))
- Update pytest to 6.2.5 ([#3310](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3310))
- Update black to 21.8b0 ([#3308](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3308))
- Update argon2-cffi to 21.1.0 ([#3306](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3306))
- Bump peter-evans/create-pull-request from 3.10.0 to 3.10.1 ([#3303](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3303))
- Update django-debug-toolbar to 3.2.2 ([#3296](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3296))
- Update django-cors-headers to 3.8.0 ([#3295](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3295))
- Update uvicorn to 0.15.0 ([#3294](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3294))
## [2021-08-27]
### Updated
- Update tox to 3.24.3 ([#3302](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3302))
## [2021-08-20]
### Changed
- Fix Jinja2 break line control on Procfile ([#3300](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3300))
## [2021-08-19]
### Changed
- Fix several minor typos ([#3301](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3301))
## [2021-08-13]
### Changed
- Upgrade to Redis 6 ([#3255](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3255))
### Fixed
- Fix RTD build image to support Python 3.9 ([#3293](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3293))
## [2021-08-12]
### Changed
- Add documentation for automating backups ([#3268](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3268))
- Add missing step to getting started locally in docs ([#3291](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3291))
- Moved isort config from `.editorconfig` to `setup.cfg` ([#3290](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3290))
- How to pre-commit in Docker Development ([#3287](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3287))
### Updated
- Update sentry-sdk to 1.3.1 ([#3281](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3281))
- Update tox to 3.24.1 ([#3285](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3285))
- Update pre-commit to 2.14.0 ([#3289](https://api.github.com/repos/pydanny/cookiecutter-django/pulls/3289))
## [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))

View File

@ -124,6 +124,13 @@ Listed in alphabetical order.
</td>
<td></td>
</tr>
<tr>
<td>Abdul Qoyyuum</td>
<td>
<a href="https://github.com/Qoyyuum">Qoyyuum</a>
</td>
<td>Qoyyuum</td>
</tr>
<tr>
<td>Adam Bogdał</td>
<td>
@ -383,6 +390,13 @@ Listed in alphabetical order.
</td>
<td></td>
</tr>
<tr>
<td>Charlie Macfarlane Brodie</td>
<td>
<a href="https://github.com/tannart">tannart</a>
</td>
<td></td>
</tr>
<tr>
<td>Charlie Smith</td>
<td>
@ -677,6 +691,13 @@ Listed in alphabetical order.
</td>
<td>windrush</td>
</tr>
<tr>
<td>Floyd Hightower</td>
<td>
<a href="https://github.com/fhightower">fhightower</a>
</td>
<td></td>
</tr>
<tr>
<td>Gabriel Mejia</td>
<td>
@ -950,6 +971,13 @@ Listed in alphabetical order.
</td>
<td></td>
</tr>
<tr>
<td>Keith Callenberg</td>
<td>
<a href="https://github.com/keithcallenberg">keithcallenberg</a>
</td>
<td></td>
</tr>
<tr>
<td>Keith Webber</td>
<td>
@ -1167,6 +1195,13 @@ Listed in alphabetical order.
</td>
<td></td>
</tr>
<tr>
<td>mfosterw</td>
<td>
<a href="https://github.com/mfosterw">mfosterw</a>
</td>
<td></td>
</tr>
<tr>
<td>Michael Gecht</td>
<td>
@ -1181,6 +1216,13 @@ Listed in alphabetical order.
</td>
<td></td>
</tr>
<tr>
<td>Mike97M</td>
<td>
<a href="https://github.com/Mike97M">Mike97M</a>
</td>
<td></td>
</tr>
<tr>
<td>Min ho Kim</td>
<td>

View File

@ -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
-------------
@ -205,7 +213,7 @@ Developing locally with HTTPS
Increasingly it is becoming necessary to develop software in a secure environment in order that there are very few changes when deploying to production. Recently Facebook changed their policies for apps/sites that use Facebook login which requires the use of an HTTPS URL for the OAuth redirect URL. So if you want to use the ``users`` application with a OAuth provider such as Facebook, securing your communication to the local development environment will be necessary.
On order to create a secure environment, we need to have a trusted SSL certficate installed in our Docker application.
In order to create a secure environment, we need to have a trusted SSL certficate installed in our Docker application.
#. **Let's Encrypt**
@ -225,14 +233,14 @@ On order to create a secure environment, we need to have a trusted SSL certficat
.. _`mkcert`: https://github.com/FiloSottile/mkcert/blob/master/README.md#supported-root-stores
After installing a trusted TLS certificate, configure your docker installation. We are going to configure an ``nginx`` reverse-proxy server. This makes sure that it does not interfere with our ``traefik`` configuration that is reserved for production environements.
After installing a trusted TLS certificate, configure your docker installation. We are going to configure an ``nginx`` reverse-proxy server. This makes sure that it does not interfere with our ``traefik`` configuration that is reserved for production environments.
These are the places that you should configure to secure your local environment.
certs
~~~~~
Take the certificates that you generated and place them in a folder called ``certs`` on the projects root folder. Assuming that you registered your local hostname as ``my-dev-env.local``, the certificates you will put in the folder should have the names ``my-dev-env.local.crt`` and ``my-dev-env.local.key``.
Take the certificates that you generated and place them in a folder called ``certs`` in the project's root folder. Assuming that you registered your local hostname as ``my-dev-env.local``, the certificates you will put in the folder should have the names ``my-dev-env.local.crt`` and ``my-dev-env.local.key``.
local.yml
~~~~~~~~~
@ -256,7 +264,7 @@ local.yml
...
#. Link the ``nginx-proxy`` to ``django`` through environmental variables.
#. Link the ``nginx-proxy`` to ``django`` through environment variables.
``django`` already has an ``.env`` file connected to it. Add the following variables. You should do this especially if you are working with a team and you want to keep your local environment details to yourself.

View File

@ -30,6 +30,7 @@ First things first.
#. Install development requirements: ::
$ cd <what you have entered as the project_slug at setup stage>
$ pip install -r requirements/local.txt
$ git init # A git repo is required for pre-commit to install
$ pre-commit install

View File

@ -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
----------------------------------

View File

@ -49,11 +49,10 @@ use_docker:
postgresql_version:
Select a PostgreSQL_ version to use. The choices are:
1. 12.3
2. 11.8
3. 10.8
4. 9.6
5. 9.5
1. 13.2
2. 12.6
3. 11.11
4. 10.16
js_task_runner:
Select a JavaScript task runner. The choices are:

View File

@ -4,16 +4,16 @@ binaryornot==0.4.4
# Code quality
# ------------------------------------------------------------------------------
black==21.6b0
isort==5.9.1
black==21.8b0
isort==5.9.3
flake8==3.9.2
flake8-isort==4.0.0
pre-commit==2.13.0
pre-commit==2.15.0
# Testing
# ------------------------------------------------------------------------------
tox==3.23.1
pytest==6.2.4
tox==3.24.3
pytest==6.2.5
pytest-cookies==0.6.1
pytest-instafail==0.4.2
pyyaml==5.4.1

View File

@ -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}"')

View File

@ -281,3 +281,20 @@ def test_error_if_incompatible(cookies, context, invalid_context):
assert result.exit_code != 0
assert isinstance(result.exception, FailedHookException)
@pytest.mark.parametrize(
["use_pycharm", "pycharm_docs_exist"],
[
("n", False),
("y", True),
],
)
def test_pycharm_docs_removed(cookies, context, use_pycharm, pycharm_docs_exist):
"""."""
context.update({"use_pycharm": use_pycharm})
result = cookies.bake(extra_context=context)
with open(f"{result.project}/docs/index.rst", "r") as f:
has_pycharm_docs = "pycharm/configuration" in f.read()
assert has_pycharm_docs is pycharm_docs_exist

View File

@ -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

View File

@ -42,7 +42,7 @@ jobs:
services:
{%- if cookiecutter.use_celery == 'y' %}
redis:
image: redis:5.0
image: redis:6
ports:
- 6379:6379
{%- endif %}

View File

@ -11,12 +11,12 @@ repos:
- id: check-yaml
- repo: https://github.com/psf/black
rev: 21.6b0
rev: 21.8b0
hooks:
- id: black
- repo: https://github.com/timothycrosley/isort
rev: 5.9.1
rev: 5.9.3
hooks:
- id: isort

View File

@ -3,6 +3,9 @@ version: 2
sphinx:
configuration: docs/conf.py
build:
image: testing
python:
version: 3.9
install:

View File

@ -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 %}
{%- else %}
web: gunicorn config.wsgi:application
{%- endif %}
{%- if cookiecutter.use_celery == "y" -%}
worker: REMAP_SIGTERM=SIGQUIT celery worker --app=config.celery_app --loglevel=info
beat: REMAP_SIGTERM=SIGQUIT celery beat --app=config.celery_app --loglevel=info
{% if cookiecutter.use_celery == "y" -%}
worker: REMAP_SIGTERM=SIGQUIT celery -A config.celery_app worker --loglevel=info
beat: REMAP_SIGTERM=SIGQUIT celery -A config.celery_app beat --loglevel=info
{%- endif %}

View File

@ -4,7 +4,8 @@ set -o errexit
set -o nounset
celery flower \
--app=config.celery_app \
--broker="${CELERY_BROKER_URL}" \
celery \
-A config.celery_app \
-b "${CELERY_BROKER_URL}" \
flower \
--basic_auth="${CELERY_FLOWER_USER}:${CELERY_FLOWER_PASSWORD}"

View File

@ -4,7 +4,8 @@ set -o errexit
set -o nounset
celery flower \
--app=config.celery_app \
--broker="${CELERY_BROKER_URL}" \
celery \
-A config.celery_app \
-b "${CELERY_BROKER_URL}" \
flower \
--basic_auth="${CELERY_FLOWER_USER}:${CELERY_FLOWER_PASSWORD}"

View File

@ -10,8 +10,8 @@ Welcome to {{ cookiecutter.project_name }}'s documentation!
:maxdepth: 2
:caption: Contents:
howto
pycharm/configuration
howto{% if cookiecutter.use_pycharm == 'y' %}
pycharm/configuration{% endif %}
users

View File

@ -64,7 +64,7 @@ services:
{%- if cookiecutter.use_celery == 'y' %}
redis:
image: redis:5.0
image: redis:6
container_name: redis
celeryworker:

View File

@ -47,7 +47,7 @@ services:
{%- endif %}
redis:
image: redis:5.0
image: redis:6
{%- if cookiecutter.use_celery == 'y' %}
celeryworker:

View File

@ -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.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
@ -8,31 +8,31 @@ rcssmin==1.0.6 --install-option="--without-c-extensions" # https://github.com/n
rcssmin==1.0.6 # https://github.com/ndparker/rcssmin
{%- endif %}
{%- endif %}
argon2-cffi==20.1.0 # https://github.com/hynek/argon2_cffi
argon2-cffi==21.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
django-celery-beat==2.2.0 # https://github.com/celery/django-celery-beat
celery==5.1.2 # pyup: < 6.0 # https://github.com/celery/celery
django-celery-beat==2.2.1 # https://github.com/celery/django-celery-beat
{%- if cookiecutter.use_docker == 'y' %}
flower==0.9.7 # https://github.com/mher/flower
flower==1.0.0 # https://github.com/mher/flower
{%- endif %}
{%- endif %}
{%- if cookiecutter.use_async == 'y' %}
uvicorn[standard]==0.14.0 # https://github.com/encode/uvicorn
uvicorn[standard]==0.15.0 # https://github.com/encode/uvicorn
{%- endif %}
# Django
# ------------------------------------------------------------------------------
django==3.1.13 # pyup: < 3.2 # https://www.djangoproject.com/
django-environ==0.4.5 # https://github.com/joke2k/django-environ
django-environ==0.7.0 # 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
@ -41,5 +41,5 @@ django-redis==5.0.0 # https://github.com/jazzband/django-redis
{%- if cookiecutter.use_drf == "y" %}
# 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
django-cors-headers==3.8.0 # https://github.com/adamchainz/django-cors-headers
{%- endif %}

View File

@ -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==6.2.5 # 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,18 +28,18 @@ 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.8b0 # 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.15.0 # https://github.com/pre-commit/pre-commit
# Django
# ------------------------------------------------------------------------------
factory-boy==3.2.0 # https://github.com/FactoryBoy/factory_boy
django-debug-toolbar==3.2.1 # https://github.com/jazzband/django-debug-toolbar
django-debug-toolbar==3.2.2 # https://github.com/jazzband/django-debug-toolbar
django-extensions==3.1.3 # https://github.com/django-extensions/django-extensions
django-coverage-plugin==2.0.0 # https://github.com/nedbat/django_coverage_plugin
pytest-django==4.4.0 # https://github.com/pytest-dev/pytest-django

View File

@ -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

View File

@ -1 +1 @@
python-3.9.4
python-3.9.7

View File

@ -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

View File

@ -2,11 +2,11 @@
{% load i18n %}
{% block head_title %}{% trans "Account Inactive" %}{% endblock %}
{% block head_title %}{% translate "Account Inactive" %}{% endblock %}
{% block inner %}
<h1>{% trans "Account Inactive" %}</h1>
<h1>{% translate "Account Inactive" %}</h1>
<p>{% trans "This account is inactive." %}</p>
<p>{% translate "This account is inactive." %}</p>
{% endblock %}
{%- endraw %}

View File

@ -4,13 +4,13 @@
{% load i18n %}
{% load crispy_forms_tags %}
{% block head_title %}{% trans "Account" %}{% endblock %}
{% block head_title %}{% translate "Account" %}{% endblock %}
{% block inner %}
<h1>{% trans "E-mail Addresses" %}</h1>
<h1>{% translate "E-mail Addresses" %}</h1>
{% if user.emailaddress_set.all %}
<p>{% trans 'The following e-mail addresses are associated with your account:' %}</p>
<p>{% translate 'The following e-mail addresses are associated with your account:' %}</p>
<form action="{% url 'account_email' %}" class="email_list" method="post">
{% csrf_token %}
@ -24,36 +24,36 @@
{{ emailaddress.email }}
{% if emailaddress.verified %}
<span class="verified">{% trans "Verified" %}</span>
<span class="verified">{% translate "Verified" %}</span>
{% else %}
<span class="unverified">{% trans "Unverified" %}</span>
<span class="unverified">{% translate "Unverified" %}</span>
{% endif %}
{% if emailaddress.primary %}<span class="primary">{% trans "Primary" %}</span>{% endif %}
{% if emailaddress.primary %}<span class="primary">{% translate "Primary" %}</span>{% endif %}
</label>
</div>
{% endfor %}
<div class="form-group">
<button class="secondaryAction btn btn-primary" type="submit" name="action_primary" >{% trans 'Make Primary' %}</button>
<button class="secondaryAction btn btn-primary" type="submit" name="action_send" >{% trans 'Re-send Verification' %}</button>
<button class="primaryAction btn btn-primary" type="submit" name="action_remove" >{% trans 'Remove' %}</button>
<button class="secondaryAction btn btn-primary" type="submit" name="action_primary" >{% translate 'Make Primary' %}</button>
<button class="secondaryAction btn btn-primary" type="submit" name="action_send" >{% translate 'Re-send Verification' %}</button>
<button class="primaryAction btn btn-primary" type="submit" name="action_remove" >{% translate 'Remove' %}</button>
</div>
</fieldset>
</form>
{% else %}
<p><strong>{% trans 'Warning:'%}</strong> {% 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." %}</p>
<p><strong>{% translate 'Warning:'%}</strong> {% 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." %}</p>
{% endif %}
<h2>{% trans "Add E-mail Address" %}</h2>
<h2>{% translate "Add E-mail Address" %}</h2>
<form method="post" action="{% url 'account_email' %}" class="add_email">
{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-primary" name="action_add" type="submit">{% trans "Add E-mail" %}</button>
<button class="btn btn-primary" name="action_add" type="submit">{% translate "Add E-mail" %}</button>
</form>
{% endblock %}
@ -63,7 +63,7 @@
{{ block.super }}
<script type="text/javascript">
window.addEventListener('DOMContentLoaded',function() {
const message = "{% trans 'Do you really want to remove the selected e-mail address?' %}";
const message = "{% translate 'Do you really want to remove the selected e-mail address?' %}";
const actions = document.getElementsByName('action_remove');
if (actions.length) {
actions[0].addEventListener("click", function(e) {

View File

@ -3,28 +3,28 @@
{% load i18n %}
{% load account %}
{% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %}
{% block head_title %}{% translate "Confirm E-mail Address" %}{% endblock %}
{% block inner %}
<h1>{% trans "Confirm E-mail Address" %}</h1>
<h1>{% translate "Confirm E-mail Address" %}</h1>
{% if confirmation %}
{% user_display confirmation.email_address.user as user_display %}
<p>{% blocktrans with confirmation.email_address.email as email %}Please confirm that <a href="mailto:{{ email }}">{{ email }}</a> is an e-mail address for user {{ user_display }}.{% endblocktrans %}</p>
<p>{% blocktranslate with confirmation.email_address.email as email %}Please confirm that <a href="mailto:{{ email }}">{{ email }}</a> is an e-mail address for user {{ user_display }}.{% endblocktranslate %}</p>
<form method="post" action="{% url 'account_confirm_email' confirmation.key %}">
{% csrf_token %}
<button class="btn btn-primary" type="submit">{% trans 'Confirm' %}</button>
<button class="btn btn-primary" type="submit">{% translate 'Confirm' %}</button>
</form>
{% else %}
{% url 'account_email' as email_url %}
<p>{% blocktrans %}This e-mail confirmation link expired or is invalid. Please <a href="{{ email_url }}">issue a new e-mail confirmation request</a>.{% endblocktrans %}</p>
<p>{% blocktranslate %}This e-mail confirmation link expired or is invalid. Please <a href="{{ email_url }}">issue a new e-mail confirmation request</a>.{% endblocktranslate %}</p>
{% endif %}

View File

@ -4,18 +4,18 @@
{% load account socialaccount %}
{% load crispy_forms_tags %}
{% block head_title %}{% trans "Sign In" %}{% endblock %}
{% block head_title %}{% translate "Sign In" %}{% endblock %}
{% block inner %}
<h1>{% trans "Sign In" %}</h1>
<h1>{% translate "Sign In" %}</h1>
{% get_providers as socialaccount_providers %}
{% if socialaccount_providers %}
<p>{% blocktrans with site.name as site_name %}Please sign in with one
<p>{% blocktranslate with site.name as site_name %}Please sign in with one
of your existing third party accounts. Or, <a href="{{ signup_url }}">sign up</a>
for a {{ site_name }} account and sign in below:{% endblocktrans %}</p>
for a {{ site_name }} account and sign in below:{% endblocktranslate %}</p>
<div class="socialaccount_ballot">
@ -23,15 +23,15 @@ for a {{ site_name }} account and sign in below:{% endblocktrans %}</p>
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
</ul>
<div class="login-or">{% trans 'or' %}</div>
<div class="login-or">{% translate 'or' %}</div>
</div>
{% include "socialaccount/snippets/login_extra.html" %}
{% else %}
<p>{% blocktrans %}If you have not created an account yet, then please
<a href="{{ signup_url }}">sign up</a> first.{% endblocktrans %}</p>
<p>{% blocktranslate %}If you have not created an account yet, then please
<a href="{{ signup_url }}">sign up</a> first.{% endblocktranslate %}</p>
{% endif %}
<form class="login" method="POST" action="{% url 'account_login' %}">
@ -40,8 +40,8 @@ for a {{ site_name }} account and sign in below:{% endblocktrans %}</p>
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %}
<a class="button secondaryAction" href="{% url 'account_reset_password' %}">{% trans "Forgot Password?" %}</a>
<button class="primaryAction btn btn-primary" type="submit">{% trans "Sign In" %}</button>
<a class="button secondaryAction" href="{% url 'account_reset_password' %}">{% translate "Forgot Password?" %}</a>
<button class="primaryAction btn btn-primary" type="submit">{% translate "Sign In" %}</button>
</form>
{% endblock %}

View File

@ -2,19 +2,19 @@
{% load i18n %}
{% block head_title %}{% trans "Sign Out" %}{% endblock %}
{% block head_title %}{% translate "Sign Out" %}{% endblock %}
{% block inner %}
<h1>{% trans "Sign Out" %}</h1>
<h1>{% translate "Sign Out" %}</h1>
<p>{% trans 'Are you sure you want to sign out?' %}</p>
<p>{% translate 'Are you sure you want to sign out?' %}</p>
<form method="post" action="{% url 'account_logout' %}">
{% csrf_token %}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>
{% endif %}
<button class="btn btn-danger" type="submit">{% trans 'Sign Out' %}</button>
<button class="btn btn-danger" type="submit">{% translate 'Sign Out' %}</button>
</form>
{% endblock %}
{%- endraw %}

View File

@ -3,15 +3,15 @@
{% load i18n %}
{% load crispy_forms_tags %}
{% block head_title %}{% trans "Change Password" %}{% endblock %}
{% block head_title %}{% translate "Change Password" %}{% endblock %}
{% block inner %}
<h1>{% trans "Change Password" %}</h1>
<h1>{% translate "Change Password" %}</h1>
<form method="POST" action="{% url 'account_change_password' %}" class="password_change">
{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-primary" type="submit" name="action">{% trans "Change Password" %}</button>
<button class="btn btn-primary" type="submit" name="action">{% translate "Change Password" %}</button>
</form>
{% endblock %}
{%- endraw %}

View File

@ -4,23 +4,23 @@
{% load account %}
{% load crispy_forms_tags %}
{% block head_title %}{% trans "Password Reset" %}{% endblock %}
{% block head_title %}{% translate "Password Reset" %}{% endblock %}
{% block inner %}
<h1>{% trans "Password Reset" %}</h1>
<h1>{% translate "Password Reset" %}</h1>
{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
{% endif %}
<p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}</p>
<p>{% translate "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}</p>
<form method="POST" action="{% url 'account_reset_password' %}" class="password_reset">
{% csrf_token %}
{{ form|crispy }}
<input class="btn btn-primary" type="submit" value="{% trans 'Reset My Password' %}" />
<input class="btn btn-primary" type="submit" value="{% translate 'Reset My Password' %}" />
</form>
<p>{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}</p>
<p>{% blocktranslate %}Please contact us if you have any trouble resetting your password.{% endblocktranslate %}</p>
{% endblock %}
{%- endraw %}

View File

@ -3,15 +3,15 @@
{% load i18n %}
{% load account %}
{% block head_title %}{% trans "Password Reset" %}{% endblock %}
{% block head_title %}{% translate "Password Reset" %}{% endblock %}
{% block inner %}
<h1>{% trans "Password Reset" %}</h1>
<h1>{% translate "Password Reset" %}</h1>
{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
{% endif %}
<p>{% blocktrans %}We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}</p>
<p>{% blocktranslate %}We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.{% endblocktranslate %}</p>
{% endblock %}
{%- endraw %}

View File

@ -2,23 +2,23 @@
{% load i18n %}
{% load crispy_forms_tags %}
{% block head_title %}{% trans "Change Password" %}{% endblock %}
{% block head_title %}{% translate "Change Password" %}{% endblock %}
{% block inner %}
<h1>{% if token_fail %}{% trans "Bad Token" %}{% else %}{% trans "Change Password" %}{% endif %}</h1>
<h1>{% if token_fail %}{% translate "Bad Token" %}{% else %}{% translate "Change Password" %}{% endif %}</h1>
{% if token_fail %}
{% url 'account_reset_password' as passwd_reset_url %}
<p>{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.{% endblocktrans %}</p>
<p>{% blocktranslate %}The password reset link was invalid, possibly because it has already been used. Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.{% endblocktranslate %}</p>
{% else %}
{% if form %}
<form method="POST" action=".">
{% csrf_token %}
{{ form|crispy }}
<input class="btn btn-primary" type="submit" name="action" value="{% trans 'change password' %}"/>
<input class="btn btn-primary" type="submit" name="action" value="{% translate 'change password' %}"/>
</form>
{% else %}
<p>{% trans 'Your password is now changed.' %}</p>
<p>{% translate 'Your password is now changed.' %}</p>
{% endif %}
{% endif %}
{% endblock %}

View File

@ -1,10 +1,10 @@
{% raw %}{% extends "account/base.html" %}
{% load i18n %}
{% block head_title %}{% trans "Change Password" %}{% endblock %}
{% block head_title %}{% translate "Change Password" %}{% endblock %}
{% block inner %}
<h1>{% trans "Change Password" %}</h1>
<p>{% trans 'Your password is now changed.' %}</p>
<h1>{% translate "Change Password" %}</h1>
<p>{% translate 'Your password is now changed.' %}</p>
{% endblock %}
{%- endraw %}

View File

@ -3,15 +3,15 @@
{% load i18n %}
{% load crispy_forms_tags %}
{% block head_title %}{% trans "Set Password" %}{% endblock %}
{% block head_title %}{% translate "Set Password" %}{% endblock %}
{% block inner %}
<h1>{% trans "Set Password" %}</h1>
<h1>{% translate "Set Password" %}</h1>
<form method="POST" action="{% url 'account_set_password' %}" class="password_set">
{% csrf_token %}
{{ form|crispy }}
<input class="btn btn-primary" type="submit" name="action" value="{% trans 'Set Password' %}"/>
<input class="btn btn-primary" type="submit" name="action" value="{% translate 'Set Password' %}"/>
</form>
{% endblock %}
{%- endraw %}

View File

@ -3,12 +3,12 @@
{% load i18n %}
{% load crispy_forms_tags %}
{% block head_title %}{% trans "Signup" %}{% endblock %}
{% block head_title %}{% translate "Signup" %}{% endblock %}
{% block inner %}
<h1>{% trans "Sign Up" %}</h1>
<h1>{% translate "Sign Up" %}</h1>
<p>{% blocktrans %}Already have an account? Then please <a href="{{ login_url }}">sign in</a>.{% endblocktrans %}</p>
<p>{% blocktranslate %}Already have an account? Then please <a href="{{ login_url }}">sign in</a>.{% endblocktranslate %}</p>
<form class="signup" id="signup_form" method="post" action="{% url 'account_signup' %}">
{% csrf_token %}
@ -16,7 +16,7 @@
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %}
<button class="btn btn-primary" type="submit">{% trans "Sign Up" %} &raquo;</button>
<button class="btn btn-primary" type="submit">{% translate "Sign Up" %} &raquo;</button>
</form>
{% endblock %}

View File

@ -2,11 +2,11 @@
{% load i18n %}
{% block head_title %}{% trans "Sign Up Closed" %}{% endblock %}
{% block head_title %}{% translate "Sign Up Closed" %}{% endblock %}
{% block inner %}
<h1>{% trans "Sign Up Closed" %}</h1>
<h1>{% translate "Sign Up Closed" %}</h1>
<p>{% trans "We are sorry, but the sign up is currently closed." %}</p>
<p>{% translate "We are sorry, but the sign up is currently closed." %}</p>
{% endblock %}
{%- endraw %}

View File

@ -2,12 +2,12 @@
{% load i18n %}
{% block head_title %}{% trans "Verify Your E-mail Address" %}{% endblock %}
{% block head_title %}{% translate "Verify Your E-mail Address" %}{% endblock %}
{% block inner %}
<h1>{% trans "Verify Your E-mail Address" %}</h1>
<h1>{% translate "Verify Your E-mail Address" %}</h1>
<p>{% 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 %}</p>
<p>{% blocktranslate %}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.{% endblocktranslate %}</p>
{% endblock %}
{%- endraw %}

View File

@ -2,21 +2,21 @@
{% load i18n %}
{% block head_title %}{% trans "Verify Your E-mail Address" %}{% endblock %}
{% block head_title %}{% translate "Verify Your E-mail Address" %}{% endblock %}
{% block inner %}
<h1>{% trans "Verify Your E-mail Address" %}</h1>
<h1>{% translate "Verify Your E-mail Address" %}</h1>
{% url 'account_email' as email_url %}
<p>{% blocktrans %}This part of the site requires us to verify that
<p>{% blocktranslate %}This part of the site requires us to verify that
you are who you claim to be. For this purpose, we require that you
verify ownership of your e-mail address. {% endblocktrans %}</p>
verify ownership of your e-mail address. {% endblocktranslate %}</p>
<p>{% blocktrans %}We have sent an e-mail to you for
<p>{% blocktranslate %}We have sent an e-mail to you for
verification. Please click on the link inside this e-mail. Please
contact us if you do not receive it within a few minutes.{% endblocktrans %}</p>
contact us if you do not receive it within a few minutes.{% endblocktranslate %}</p>
<p>{% blocktrans %}<strong>Note:</strong> you can still <a href="{{ email_url }}">change your e-mail address</a>.{% endblocktrans %}</p>
<p>{% blocktranslate %}<strong>Note:</strong> you can still <a href="{{ email_url }}">change your e-mail address</a>.{% endblocktranslate %}</p>
{% endblock %}
{%- endraw %}

View File

@ -78,20 +78,20 @@
{% if request.user.is_authenticated %}
<li class="nav-item">
{# URL provided by django-allauth/account/urls.py #}
<a class="nav-link" href="{% url 'users:detail' request.user.username %}">{% trans "My Profile" %}</a>
<a class="nav-link" href="{% url 'users:detail' request.user.username %}">{% translate "My Profile" %}</a>
</li>
<li class="nav-item">
{# URL provided by django-allauth/account/urls.py #}
<a class="nav-link" href="{% url 'account_logout' %}">{% trans "Sign Out" %}</a>
<a class="nav-link" href="{% url 'account_logout' %}">{% translate "Sign Out" %}</a>
</li>
{% else %}
<li class="nav-item">
{# URL provided by django-allauth/account/urls.py #}
<a id="sign-up-link" class="nav-link" href="{% url 'account_signup' %}">{% trans "Sign Up" %}</a>
<a id="sign-up-link" class="nav-link" href="{% url 'account_signup' %}">{% translate "Sign Up" %}</a>
</li>
<li class="nav-item">
{# URL provided by django-allauth/account/urls.py #}
<a id="log-in-link" class="nav-link" href="{% url 'account_login' %}">{% trans "Sign In" %}</a>
<a id="log-in-link" class="nav-link" href="{% url 'account_login' %}">{% translate "Sign In" %}</a>
</li>
{% endif %}
</ul>