diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c8430927..42cce9d2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,19 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.02.26 + + +### Changed + +- Allauth elements & MFA ([#4843](https://github.com/cookiecutter/cookiecutter-django/pull/4843)) + +### Updated + +- Update pytest to 8.0.2 ([#4890](https://github.com/cookiecutter/cookiecutter-django/pull/4890)) + +- Update crispy-bootstrap5 to 2024.2 ([#4891](https://github.com/cookiecutter/cookiecutter-django/pull/4891)) + ## 2024.02.24 diff --git a/requirements.txt b/requirements.txt index 138744a26..70bc7df81 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ pre-commit==3.6.2 # Testing # ------------------------------------------------------------------------------ tox==4.13.0 -pytest==8.0.1 +pytest==8.0.2 pytest-xdist==3.5.0 pytest-cookies==0.7.0 pytest-instafail==0.5.0 diff --git a/setup.py b/setup.py index f5a26920f..8c2374049 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.02.24" +version = "2024.02.26" with open("README.md") as readme_file: long_description = readme_file.read() diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 55a064e74..b7eb7e80f 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -84,6 +84,7 @@ THIRD_PARTY_APPS = [ "crispy_bootstrap5", "allauth", "allauth.account", + "allauth.mfa", "allauth.socialaccount", {%- if cookiecutter.use_celery == 'y' %} "django_celery_beat", diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index f090018ef..ea0524ebd 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -31,9 +31,9 @@ uvicorn[standard]==0.27.1 # https://github.com/encode/uvicorn django==4.2.10 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.11.2 # https://github.com/joke2k/django-environ django-model-utils==4.4.0 # https://github.com/jazzband/django-model-utils -django-allauth==0.61.1 # https://github.com/pennersr/django-allauth +django-allauth[mfa]==0.61.1 # https://github.com/pennersr/django-allauth django-crispy-forms==2.1 # https://github.com/django-crispy-forms/django-crispy-forms -crispy-bootstrap5==2023.10 # https://github.com/django-crispy-forms/crispy-bootstrap5 +crispy-bootstrap5==2024.2 # https://github.com/django-crispy-forms/crispy-bootstrap5 {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} django-compressor==4.4 # https://github.com/django-compressor/django-compressor {%- endif %} diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 618226f6d..0de14977a 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -15,7 +15,7 @@ watchfiles==0.21.0 # https://github.com/samuelcolvin/watchfiles # ------------------------------------------------------------------------------ mypy==1.7.1 # https://github.com/python/mypy django-stubs[compatible-mypy]==4.2.7 # https://github.com/typeddjango/django-stubs -pytest==8.0.1 # https://github.com/pytest-dev/pytest +pytest==8.0.2 # https://github.com/pytest-dev/pytest pytest-sugar==1.0.0 # https://github.com/Frozenball/pytest-sugar {%- if cookiecutter.use_drf == "y" %} djangorestframework-stubs[compatible-mypy]==3.14.5 # https://github.com/typeddjango/djangorestframework-stubs 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 deleted file mode 100644 index a9112cf09..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/account_inactive.html +++ /dev/null @@ -1,12 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Account Inactive" %} -{% endblock head_title %} -{% block inner %} -
{% translate "This account is inactive." %}
-{% endblock inner %} -{%- 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 deleted file mode 100644 index 057618257..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base.html +++ /dev/null @@ -1,14 +0,0 @@ -{% raw %}{% extends "base.html" %} - -{% block title %} - {% block head_title %} - {% endblock head_title %} -{% endblock title %} -{% block content %} -{% translate "The following e-mail addresses are associated with your account:" %}
- - {% else %} -- {% 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 %} -- {% blocktranslate with confirmation.email_address.email as email %}Please confirm that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktranslate %} -
- - {% else %} - {% url 'account_email' as email_url %} -- {% blocktranslate %}This e-mail confirmation link expired or is invalid. Please issue a new e-mail confirmation request.{% endblocktranslate %} -
- {% endif %} -{% endblock inner %} -{%- 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 deleted file mode 100644 index 5737afc06..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/login.html +++ /dev/null @@ -1,53 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load account socialaccount %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Sign In" %} -{% endblock head_title %} -{% block inner %} -- {% translate "Please sign in with one of your existing third party accounts:" %} - {% if ACCOUNT_ALLOW_REGISTRATION %} - {% blocktranslate trimmed %} - Or, sign up - for a {{ site_name }} account and sign in below: - {% endblocktranslate %} - {% endif %} -
- - {% include "socialaccount/snippets/login_extra.html" %} - {% else %} - {% if ACCOUNT_ALLOW_REGISTRATION %} -- {% blocktranslate trimmed %} - If you have not created an account yet, then please - sign up first. - {% endblocktranslate %} -
- {% endif %} - {% endif %} - -{% endblock inner %} -{%- 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 deleted file mode 100644 index 43ae9ed38..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/logout.html +++ /dev/null @@ -1,21 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Sign Out" %} -{% endblock head_title %} -{% block inner %} -{% translate "Are you sure you want to sign out?" %}
- -{% endblock inner %} -{%- 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 deleted file mode 100644 index 2e6110d5d..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_change.html +++ /dev/null @@ -1,19 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Change Password" %} -{% endblock head_title %} -{% block inner %} -- {% translate "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %} -
- -{% blocktranslate %}Please contact us if you have any trouble resetting your password.{% endblocktranslate %}
-{% endblock inner %} -{%- 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 deleted file mode 100644 index a596425bb..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_done.html +++ /dev/null @@ -1,18 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load account %} - -{% block head_title %} - {% translate "Password Reset" %} -{% endblock head_title %} -{% block inner %} -- {% blocktranslate %}We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.{% endblocktranslate %} -
-{% endblock inner %} -{%- 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 deleted file mode 100644 index a958ba089..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html +++ /dev/null @@ -1,37 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Change Password" %} -{% endblock head_title %} -{% block inner %} -- {% blocktranslate %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% endblocktranslate %} -
- {% else %} - {% if form %} - - {% else %} -{% translate "Your password is now changed." %}
- {% endif %} - {% endif %} -{% endblock inner %} -{%- 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 deleted file mode 100644 index ee399b404..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key_done.html +++ /dev/null @@ -1,12 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Change Password" %} -{% endblock head_title %} -{% block inner %} -{% translate "Your password is now changed." %}
-{% endblock inner %} -{%- 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 deleted file mode 100644 index 3efc30874..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html +++ /dev/null @@ -1,22 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Set Password" %} -{% endblock head_title %} -{% block inner %} -- {% blocktranslate %}Already have an account? Then please sign in.{% endblocktranslate %} -
- -{% endblock inner %} -{%- 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 deleted file mode 100644 index b3472ed6d..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup_closed.html +++ /dev/null @@ -1,12 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Sign Up Closed" %} -{% endblock head_title %} -{% block inner %} -{% translate "We are sorry, but the sign up is currently closed." %}
-{% endblock inner %} -{%- 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 deleted file mode 100644 index d71bbc41a..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verification_sent.html +++ /dev/null @@ -1,14 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Verify Your E-mail Address" %} -{% endblock head_title %} -{% block inner %} -- {% 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 %} -
-{% endblock inner %} -{%- 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 deleted file mode 100644 index b736581ce..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verified_email_required.html +++ /dev/null @@ -1,25 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Verify Your E-mail Address" %} -{% endblock head_title %} -{% block inner %} -- {% 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. {% endblocktranslate %} -
-- {% 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.{% endblocktranslate %} -
-- {% blocktranslate %}Note: you can still change your e-mail address.{% endblocktranslate %} -
-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/alert.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/alert.html new file mode 100644 index 000000000..090c2cbf6 --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/alert.html @@ -0,0 +1,7 @@ +{% raw %}{% load i18n %} +{% load allauth %} + +