From 38d3a02fd03d5302e277e377004bd2cbcf814e23 Mon Sep 17 00:00:00 2001 From: Dan Frankowski Date: Thu, 28 Feb 2019 11:11:50 -0600 Subject: [PATCH 01/13] update location for django-registration 3.0 --- .../templates/{registration => django_registration}/activate.html | 0 .../activation_complete.html | 0 .../{registration => django_registration}/activation_email.html | 0 .../{registration => django_registration}/activation_email.txt | 0 .../activation_email_subject.txt | 0 .../templates/{registration => django_registration}/login.html | 0 .../templates/{registration => django_registration}/logout.html | 0 .../password_change_done.html | 0 .../password_change_form.html | 0 .../password_reset_complete.html | 0 .../password_reset_confirm.html | 0 .../password_reset_done.html | 0 .../password_reset_email.html | 0 .../password_reset_form.html | 0 .../{registration => django_registration}/registration_base.html | 0 .../registration_complete.html | 0 .../{registration => django_registration}/registration_form.html | 0 17 files changed, 0 insertions(+), 0 deletions(-) rename registration_defaults/templates/{registration => django_registration}/activate.html (100%) rename registration_defaults/templates/{registration => django_registration}/activation_complete.html (100%) rename registration_defaults/templates/{registration => django_registration}/activation_email.html (100%) rename registration_defaults/templates/{registration => django_registration}/activation_email.txt (100%) rename registration_defaults/templates/{registration => django_registration}/activation_email_subject.txt (100%) rename registration_defaults/templates/{registration => django_registration}/login.html (100%) rename registration_defaults/templates/{registration => django_registration}/logout.html (100%) rename registration_defaults/templates/{registration => django_registration}/password_change_done.html (100%) rename registration_defaults/templates/{registration => django_registration}/password_change_form.html (100%) rename registration_defaults/templates/{registration => django_registration}/password_reset_complete.html (100%) rename registration_defaults/templates/{registration => django_registration}/password_reset_confirm.html (100%) rename registration_defaults/templates/{registration => django_registration}/password_reset_done.html (100%) rename registration_defaults/templates/{registration => django_registration}/password_reset_email.html (100%) rename registration_defaults/templates/{registration => django_registration}/password_reset_form.html (100%) rename registration_defaults/templates/{registration => django_registration}/registration_base.html (100%) rename registration_defaults/templates/{registration => django_registration}/registration_complete.html (100%) rename registration_defaults/templates/{registration => django_registration}/registration_form.html (100%) diff --git a/registration_defaults/templates/registration/activate.html b/registration_defaults/templates/django_registration/activate.html similarity index 100% rename from registration_defaults/templates/registration/activate.html rename to registration_defaults/templates/django_registration/activate.html diff --git a/registration_defaults/templates/registration/activation_complete.html b/registration_defaults/templates/django_registration/activation_complete.html similarity index 100% rename from registration_defaults/templates/registration/activation_complete.html rename to registration_defaults/templates/django_registration/activation_complete.html diff --git a/registration_defaults/templates/registration/activation_email.html b/registration_defaults/templates/django_registration/activation_email.html similarity index 100% rename from registration_defaults/templates/registration/activation_email.html rename to registration_defaults/templates/django_registration/activation_email.html diff --git a/registration_defaults/templates/registration/activation_email.txt b/registration_defaults/templates/django_registration/activation_email.txt similarity index 100% rename from registration_defaults/templates/registration/activation_email.txt rename to registration_defaults/templates/django_registration/activation_email.txt diff --git a/registration_defaults/templates/registration/activation_email_subject.txt b/registration_defaults/templates/django_registration/activation_email_subject.txt similarity index 100% rename from registration_defaults/templates/registration/activation_email_subject.txt rename to registration_defaults/templates/django_registration/activation_email_subject.txt diff --git a/registration_defaults/templates/registration/login.html b/registration_defaults/templates/django_registration/login.html similarity index 100% rename from registration_defaults/templates/registration/login.html rename to registration_defaults/templates/django_registration/login.html diff --git a/registration_defaults/templates/registration/logout.html b/registration_defaults/templates/django_registration/logout.html similarity index 100% rename from registration_defaults/templates/registration/logout.html rename to registration_defaults/templates/django_registration/logout.html diff --git a/registration_defaults/templates/registration/password_change_done.html b/registration_defaults/templates/django_registration/password_change_done.html similarity index 100% rename from registration_defaults/templates/registration/password_change_done.html rename to registration_defaults/templates/django_registration/password_change_done.html diff --git a/registration_defaults/templates/registration/password_change_form.html b/registration_defaults/templates/django_registration/password_change_form.html similarity index 100% rename from registration_defaults/templates/registration/password_change_form.html rename to registration_defaults/templates/django_registration/password_change_form.html diff --git a/registration_defaults/templates/registration/password_reset_complete.html b/registration_defaults/templates/django_registration/password_reset_complete.html similarity index 100% rename from registration_defaults/templates/registration/password_reset_complete.html rename to registration_defaults/templates/django_registration/password_reset_complete.html diff --git a/registration_defaults/templates/registration/password_reset_confirm.html b/registration_defaults/templates/django_registration/password_reset_confirm.html similarity index 100% rename from registration_defaults/templates/registration/password_reset_confirm.html rename to registration_defaults/templates/django_registration/password_reset_confirm.html diff --git a/registration_defaults/templates/registration/password_reset_done.html b/registration_defaults/templates/django_registration/password_reset_done.html similarity index 100% rename from registration_defaults/templates/registration/password_reset_done.html rename to registration_defaults/templates/django_registration/password_reset_done.html diff --git a/registration_defaults/templates/registration/password_reset_email.html b/registration_defaults/templates/django_registration/password_reset_email.html similarity index 100% rename from registration_defaults/templates/registration/password_reset_email.html rename to registration_defaults/templates/django_registration/password_reset_email.html diff --git a/registration_defaults/templates/registration/password_reset_form.html b/registration_defaults/templates/django_registration/password_reset_form.html similarity index 100% rename from registration_defaults/templates/registration/password_reset_form.html rename to registration_defaults/templates/django_registration/password_reset_form.html diff --git a/registration_defaults/templates/registration/registration_base.html b/registration_defaults/templates/django_registration/registration_base.html similarity index 100% rename from registration_defaults/templates/registration/registration_base.html rename to registration_defaults/templates/django_registration/registration_base.html diff --git a/registration_defaults/templates/registration/registration_complete.html b/registration_defaults/templates/django_registration/registration_complete.html similarity index 100% rename from registration_defaults/templates/registration/registration_complete.html rename to registration_defaults/templates/django_registration/registration_complete.html diff --git a/registration_defaults/templates/registration/registration_form.html b/registration_defaults/templates/django_registration/registration_form.html similarity index 100% rename from registration_defaults/templates/registration/registration_form.html rename to registration_defaults/templates/django_registration/registration_form.html From 9f2efbe6c9e14e27493dd2d5bef6d2cbde5af4fc Mon Sep 17 00:00:00 2001 From: Dan Frankowski Date: Thu, 28 Feb 2019 11:18:48 -0600 Subject: [PATCH 02/13] try more fixing --- README.rst | 10 +++++----- setup.py | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.rst b/README.rst index 97dc2c4..6666289 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ django-registration-defaults ============================ -James Bennet's `django-registration `_ +James Bennet's `django-registration `_ is awesome. But it doesn't come with any of the 15 templates required to implement the workflow of registration, login/logout, and password changing and resetting. This application simply provides a set of default templates for @@ -53,7 +53,7 @@ You can add the templates in one of two ways: "registration_defaults", "django.contrib.admin", ... - "registration", + "django_registration", ) 2. Alternatively, if ``django.template.loaders.filesystem.Loader`` is @@ -73,16 +73,16 @@ Base templates ~~~~~~~~~~~~~~ All ``registration_defaults`` templates inherit from -``registration/registration_base.html``. The default template provided for +``django_registration/registration_base.html``. The default template provided for this is simply:: {% extends "base.html" %} You must either provide a ``base.html`` for the registration templates to -inherit from, or override ``registration/registration_base.html``. The base +inherit from, or override ``django_registration/registration_base.html``. The base template should provide a ``title`` block for the content of the HTML title, and a ``content`` block for content (NOTE: this has changed from previously -using ``body`` to be more in line with `reusable app standards +using ``body`` to be more in line with `reusable app standards `_ ). For example:: diff --git a/setup.py b/setup.py index 018edc4..51390a0 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from distutils.core import setup -VERSION = '0.4.4' +VERSION = '0.4.5' setup( name='django-registration-defaults', @@ -13,7 +13,7 @@ " on ``django-registration``.", author="Charlie DeTar", author_email="cfd@media.mit.edu", - url="http://github.com/yourcelf/django-registration-defaults", + url="http://github.com/dfrankow/django-registration-defaults", license="MIT License", platforms=["any"], classifiers=[ @@ -26,8 +26,8 @@ "Framework :: Django", ], install_requires=[ - 'Django>=1.5', - 'django-registration>=1.0', + 'Django>=2.1', + 'django-registration>=3.0', ], packages=['registration_defaults'], package_dir={'registration_defaults': 'registration_defaults'}, From a050e4c2a7504fbc3a4840c9ba5328ea337c1cba Mon Sep 17 00:00:00 2001 From: Dan Frankowski Date: Thu, 28 Feb 2019 11:25:57 -0600 Subject: [PATCH 03/13] rename registration --- .../templates/django_registration/activate.html | 2 +- .../templates/django_registration/activation_complete.html | 2 +- registration_defaults/templates/django_registration/login.html | 2 +- registration_defaults/templates/django_registration/logout.html | 2 +- .../templates/django_registration/password_change_done.html | 2 +- .../templates/django_registration/password_change_form.html | 2 +- .../templates/django_registration/password_reset_complete.html | 2 +- .../templates/django_registration/password_reset_confirm.html | 2 +- .../templates/django_registration/password_reset_done.html | 2 +- .../templates/django_registration/password_reset_form.html | 2 +- .../templates/django_registration/registration_complete.html | 2 +- .../templates/django_registration/registration_form.html | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/registration_defaults/templates/django_registration/activate.html b/registration_defaults/templates/django_registration/activate.html index 4f3bdbe..7b02980 100644 --- a/registration_defaults/templates/django_registration/activate.html +++ b/registration_defaults/templates/django_registration/activate.html @@ -1,4 +1,4 @@ -{% extends "registration/registration_base.html" %} +{% extends "django_registration/registration_base.html" %} {% load i18n %} {% block title %}{% if account %}{% trans "Activation complete" %}{% else %}{% trans "Activation problem" %}{% endif %}{% endblock %} {% block content %} diff --git a/registration_defaults/templates/django_registration/activation_complete.html b/registration_defaults/templates/django_registration/activation_complete.html index c2ab8dd..34bb91f 100644 --- a/registration_defaults/templates/django_registration/activation_complete.html +++ b/registration_defaults/templates/django_registration/activation_complete.html @@ -1,4 +1,4 @@ -{% extends "registration/registration_base.html" %} +{% extends "django_registration/registration_base.html" %} {% load i18n %} {% block title %}{% trans "Activation complete" %}{% endblock %} {% block content %} diff --git a/registration_defaults/templates/django_registration/login.html b/registration_defaults/templates/django_registration/login.html index 2fd6edb..d60c5e7 100644 --- a/registration_defaults/templates/django_registration/login.html +++ b/registration_defaults/templates/django_registration/login.html @@ -1,4 +1,4 @@ -{% extends "registration/registration_base.html" %} +{% extends "django_registration/registration_base.html" %} {% load i18n %} {% block title %}{% trans "Login" %}{% endblock %} {% block content %} diff --git a/registration_defaults/templates/django_registration/logout.html b/registration_defaults/templates/django_registration/logout.html index 6759e11..1f1768f 100644 --- a/registration_defaults/templates/django_registration/logout.html +++ b/registration_defaults/templates/django_registration/logout.html @@ -1,4 +1,4 @@ -{% extends "registration/registration_base.html" %} +{% extends "django_registration/registration_base.html" %} {% load i18n %} {% block title %}{% trans "Logged out" %}{% endblock %} {% block content %} diff --git a/registration_defaults/templates/django_registration/password_change_done.html b/registration_defaults/templates/django_registration/password_change_done.html index d49d6cc..7ae2520 100644 --- a/registration_defaults/templates/django_registration/password_change_done.html +++ b/registration_defaults/templates/django_registration/password_change_done.html @@ -1,4 +1,4 @@ -{% extends "registration/registration_base.html" %} +{% extends "django_registration/registration_base.html" %} {% load i18n %} {% block title %}{% trans "Password changed" %}{% endblock %} {% block content %} diff --git a/registration_defaults/templates/django_registration/password_change_form.html b/registration_defaults/templates/django_registration/password_change_form.html index 9e04d04..8a1fd4b 100644 --- a/registration_defaults/templates/django_registration/password_change_form.html +++ b/registration_defaults/templates/django_registration/password_change_form.html @@ -1,4 +1,4 @@ -{% extends "registration/registration_base.html" %} +{% extends "django_registration/registration_base.html" %} {% load i18n %} {% block title %}{% trans "Change password" %}{% endblock %} {% block content %} diff --git a/registration_defaults/templates/django_registration/password_reset_complete.html b/registration_defaults/templates/django_registration/password_reset_complete.html index 064701e..cb591ca 100644 --- a/registration_defaults/templates/django_registration/password_reset_complete.html +++ b/registration_defaults/templates/django_registration/password_reset_complete.html @@ -1,4 +1,4 @@ -{% extends "registration/registration_base.html" %} +{% extends "django_registration/registration_base.html" %} {% load i18n %} {% block title %}{% trans "Password reset complete" %}{% endblock %} {% block content %}{% blocktrans %} diff --git a/registration_defaults/templates/django_registration/password_reset_confirm.html b/registration_defaults/templates/django_registration/password_reset_confirm.html index 5006abd..0c7a40c 100644 --- a/registration_defaults/templates/django_registration/password_reset_confirm.html +++ b/registration_defaults/templates/django_registration/password_reset_confirm.html @@ -1,4 +1,4 @@ -{% extends "registration/registration_base.html" %} +{% extends "django_registration/registration_base.html" %} {% load i18n %} {% block title %}{% trans "Confirm password reset" %}{% endblock %} {% block content %} diff --git a/registration_defaults/templates/django_registration/password_reset_done.html b/registration_defaults/templates/django_registration/password_reset_done.html index 9d283e3..6c9e780 100644 --- a/registration_defaults/templates/django_registration/password_reset_done.html +++ b/registration_defaults/templates/django_registration/password_reset_done.html @@ -1,4 +1,4 @@ -{% extends "registration/registration_base.html" %} +{% extends "django_registration/registration_base.html" %} {% load i18n %} {% block title %}{% trans "Password reset" %}{% endblock %} {% block content %} diff --git a/registration_defaults/templates/django_registration/password_reset_form.html b/registration_defaults/templates/django_registration/password_reset_form.html index 35811fe..b695da4 100644 --- a/registration_defaults/templates/django_registration/password_reset_form.html +++ b/registration_defaults/templates/django_registration/password_reset_form.html @@ -1,4 +1,4 @@ -{% extends "registration/registration_base.html" %} +{% extends "django_registration/registration_base.html" %} {% load i18n %} {% block title %}{% trans "Reset password" %}{% endblock %} {% block content %}{% blocktrans %} diff --git a/registration_defaults/templates/django_registration/registration_complete.html b/registration_defaults/templates/django_registration/registration_complete.html index 872292b..b0f8749 100644 --- a/registration_defaults/templates/django_registration/registration_complete.html +++ b/registration_defaults/templates/django_registration/registration_complete.html @@ -1,4 +1,4 @@ -{% extends "registration/registration_base.html" %} +{% extends "django_registration/registration_base.html" %} {% load i18n %} {% block title %}{% trans "Activation email sent" %}{% endblock %} {% block content %} diff --git a/registration_defaults/templates/django_registration/registration_form.html b/registration_defaults/templates/django_registration/registration_form.html index 6ca5759..2194b7e 100644 --- a/registration_defaults/templates/django_registration/registration_form.html +++ b/registration_defaults/templates/django_registration/registration_form.html @@ -1,4 +1,4 @@ -{% extends "registration/registration_base.html" %} +{% extends "django_registration/registration_base.html" %} {% load i18n %} {% block title %}{% trans "Register for an account" %}{% endblock %} {% block content %} From 5f548ea735db212133d654d3e1759e467cc236a4 Mon Sep 17 00:00:00 2001 From: Dan Frankowski Date: Thu, 28 Feb 2019 11:39:22 -0600 Subject: [PATCH 04/13] more changes for django-registration 3.0 --- .../django_registration/activate.html | 14 ---------- .../django_registration/activation_email.html | 26 ------------------- ...on_email.txt => activation_email_body.txt} | 0 .../activation_failed.html | 8 ++++++ 4 files changed, 8 insertions(+), 40 deletions(-) delete mode 100644 registration_defaults/templates/django_registration/activate.html delete mode 100644 registration_defaults/templates/django_registration/activation_email.html rename registration_defaults/templates/django_registration/{activation_email.txt => activation_email_body.txt} (100%) create mode 100644 registration_defaults/templates/django_registration/activation_failed.html diff --git a/registration_defaults/templates/django_registration/activate.html b/registration_defaults/templates/django_registration/activate.html deleted file mode 100644 index 7b02980..0000000 --- a/registration_defaults/templates/django_registration/activate.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "django_registration/registration_base.html" %} -{% load i18n %} -{% block title %}{% if account %}{% trans "Activation complete" %}{% else %}{% trans "Activation problem" %}{% endif %}{% endblock %} -{% block content %} -{% url 'auth_login' as auth_login_url %} -{% if account %} -{% blocktrans %} -Thanks {{ account }}, activation complete! -You may now login using the username and password you set at registration. -{% endblocktrans %} -{% else %} -{% blocktrans %}Oops – it seems that your activation key is invalid. Please check the url again.{% endblocktrans %} -{% endif %} -{% endblock %} diff --git a/registration_defaults/templates/django_registration/activation_email.html b/registration_defaults/templates/django_registration/activation_email.html deleted file mode 100644 index c6ebc26..0000000 --- a/registration_defaults/templates/django_registration/activation_email.html +++ /dev/null @@ -1,26 +0,0 @@ -{% load i18n %} -{% comment %} -This template is used for the html alternative of the activation email -if you use a django-registration backend that looks for it. e.g. -https://github.com/huseyinyilmaz/django-registration-extended-backend -{% endcomment %} -{% url 'registration_activate' activation_key as activation_key_url %} -{% blocktrans with sitename=site.name sitedomain=site.domain%} -

Account registration for {{ sitename }}

-

-You (or someone pretending to be you) have asked to register an account at -{{ sitename }}.
-If this wasn't you, please ignore this email and your address will be removed -from our records. -

-

-To activate this account, please click the following link within the next -{{ expiration_days }} days:
-http://{{ sitedomain }}{{ activation_key_url }} -

-

-Sincerely,
-{{ sitename }} Management -

- -{% endblocktrans %} \ No newline at end of file diff --git a/registration_defaults/templates/django_registration/activation_email.txt b/registration_defaults/templates/django_registration/activation_email_body.txt similarity index 100% rename from registration_defaults/templates/django_registration/activation_email.txt rename to registration_defaults/templates/django_registration/activation_email_body.txt diff --git a/registration_defaults/templates/django_registration/activation_failed.html b/registration_defaults/templates/django_registration/activation_failed.html new file mode 100644 index 0000000..bd51e40 --- /dev/null +++ b/registration_defaults/templates/django_registration/activation_failed.html @@ -0,0 +1,8 @@ +User activation failed. Please contact {{ sitename }} for more information. + +{% comment %} + +TODO: Add more info from the activation_error dict. +See https://django-registration.readthedocs.io/en/3.0/quickstart.html#django-registration-activation-failed-html + +{% endcomment %} From 7e609c7494820684b8d4d9b862ddb89a4fd738ea Mon Sep 17 00:00:00 2001 From: Dan Frankowski Date: Thu, 28 Feb 2019 12:00:28 -0600 Subject: [PATCH 05/13] move django auth forms to different subdir --- .../templates/{django_registration => registration}/login.html | 0 .../templates/{django_registration => registration}/logout.html | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename registration_defaults/templates/{django_registration => registration}/login.html (100%) rename registration_defaults/templates/{django_registration => registration}/logout.html (100%) diff --git a/registration_defaults/templates/django_registration/login.html b/registration_defaults/templates/registration/login.html similarity index 100% rename from registration_defaults/templates/django_registration/login.html rename to registration_defaults/templates/registration/login.html diff --git a/registration_defaults/templates/django_registration/logout.html b/registration_defaults/templates/registration/logout.html similarity index 100% rename from registration_defaults/templates/django_registration/logout.html rename to registration_defaults/templates/registration/logout.html From e7dd9580793fcdc7a559d869e5ab154bd2d43aea Mon Sep 17 00:00:00 2001 From: Dan Frankowski Date: Thu, 28 Feb 2019 12:07:26 -0600 Subject: [PATCH 06/13] django contrib urls don't have auth_. also move things around --- .../templates/django_registration/activation_complete.html | 4 +--- registration_defaults/templates/registration/login.html | 4 ++-- .../password_change_done.html | 0 .../password_change_form.html | 0 .../password_reset_complete.html | 0 .../password_reset_confirm.html | 0 .../password_reset_done.html | 0 .../password_reset_email.html | 6 +++--- .../password_reset_form.html | 0 9 files changed, 6 insertions(+), 8 deletions(-) rename registration_defaults/templates/{django_registration => registration}/password_change_done.html (100%) rename registration_defaults/templates/{django_registration => registration}/password_change_form.html (100%) rename registration_defaults/templates/{django_registration => registration}/password_reset_complete.html (100%) rename registration_defaults/templates/{django_registration => registration}/password_reset_confirm.html (100%) rename registration_defaults/templates/{django_registration => registration}/password_reset_done.html (100%) rename registration_defaults/templates/{django_registration => registration}/password_reset_email.html (84%) rename registration_defaults/templates/{django_registration => registration}/password_reset_form.html (100%) diff --git a/registration_defaults/templates/django_registration/activation_complete.html b/registration_defaults/templates/django_registration/activation_complete.html index 34bb91f..a832188 100644 --- a/registration_defaults/templates/django_registration/activation_complete.html +++ b/registration_defaults/templates/django_registration/activation_complete.html @@ -2,10 +2,8 @@ {% load i18n %} {% block title %}{% trans "Activation complete" %}{% endblock %} {% block content %} -{% url 'auth_login' as auth_login_url %} +{% url 'login' as auth_login_url %} {% blocktrans %} Thanks, activation complete! You may now login using the username and password you set at registration. {% endblocktrans %} {% endblock %} - - diff --git a/registration_defaults/templates/registration/login.html b/registration_defaults/templates/registration/login.html index d60c5e7..2ec2f39 100644 --- a/registration_defaults/templates/registration/login.html +++ b/registration_defaults/templates/registration/login.html @@ -2,14 +2,14 @@ {% load i18n %} {% block title %}{% trans "Login" %}{% endblock %} {% block content %} -{% url 'auth_password_reset' as auth_pwd_reset_url %} +{% url 'password_reset' as auth_pwd_reset_url %} {% url 'registration_register' as register_url%} {% if form.errors %}

{% blocktrans %}Your username and password didn't match. Please try again.{% endblocktrans %}

{% endif %} -
{% csrf_token %} +{% csrf_token %} diff --git a/registration_defaults/templates/django_registration/password_change_done.html b/registration_defaults/templates/registration/password_change_done.html similarity index 100% rename from registration_defaults/templates/django_registration/password_change_done.html rename to registration_defaults/templates/registration/password_change_done.html diff --git a/registration_defaults/templates/django_registration/password_change_form.html b/registration_defaults/templates/registration/password_change_form.html similarity index 100% rename from registration_defaults/templates/django_registration/password_change_form.html rename to registration_defaults/templates/registration/password_change_form.html diff --git a/registration_defaults/templates/django_registration/password_reset_complete.html b/registration_defaults/templates/registration/password_reset_complete.html similarity index 100% rename from registration_defaults/templates/django_registration/password_reset_complete.html rename to registration_defaults/templates/registration/password_reset_complete.html diff --git a/registration_defaults/templates/django_registration/password_reset_confirm.html b/registration_defaults/templates/registration/password_reset_confirm.html similarity index 100% rename from registration_defaults/templates/django_registration/password_reset_confirm.html rename to registration_defaults/templates/registration/password_reset_confirm.html diff --git a/registration_defaults/templates/django_registration/password_reset_done.html b/registration_defaults/templates/registration/password_reset_done.html similarity index 100% rename from registration_defaults/templates/django_registration/password_reset_done.html rename to registration_defaults/templates/registration/password_reset_done.html diff --git a/registration_defaults/templates/django_registration/password_reset_email.html b/registration_defaults/templates/registration/password_reset_email.html similarity index 84% rename from registration_defaults/templates/django_registration/password_reset_email.html rename to registration_defaults/templates/registration/password_reset_email.html index 287737f..b26fd8a 100644 --- a/registration_defaults/templates/django_registration/password_reset_email.html +++ b/registration_defaults/templates/registration/password_reset_email.html @@ -1,17 +1,17 @@ {% load i18n %}{% trans "Greetings" %} {% if user.get_full_name %}{{ user.get_full_name }}{% else %}{{ user }}{% endif %}, {% blocktrans %}You are receiving this email because you (or someone pretending to be you) -requested that your password be reset on the {{ domain }} site. If you do not +requested that your password be reset on the {{ domain }} site. If you do not wish to reset your password, please ignore this message. To reset your password, please click the following link, or copy and paste it into your web browser:{% endblocktrans %} -{{ protocol }}://{{ domain }}{% url 'auth_password_reset_confirm' uid token %} +{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uid token %} {% blocktrans with username=user.username %} Your username, in case you've forgotten: {{ username }} Best regards, {{ site_name }} Management -{% endblocktrans %} \ No newline at end of file +{% endblocktrans %} diff --git a/registration_defaults/templates/django_registration/password_reset_form.html b/registration_defaults/templates/registration/password_reset_form.html similarity index 100% rename from registration_defaults/templates/django_registration/password_reset_form.html rename to registration_defaults/templates/registration/password_reset_form.html From fe17d4e40eb5fd21876437e67aeee1fb92df068a Mon Sep 17 00:00:00 2001 From: Dan Frankowski Date: Thu, 28 Feb 2019 12:21:08 -0600 Subject: [PATCH 07/13] another fix --- .../templates/django_registration/activation_email_body.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/registration_defaults/templates/django_registration/activation_email_body.txt b/registration_defaults/templates/django_registration/activation_email_body.txt index 9ca54b3..6298d3c 100644 --- a/registration_defaults/templates/django_registration/activation_email_body.txt +++ b/registration_defaults/templates/django_registration/activation_email_body.txt @@ -1,15 +1,15 @@ {% load i18n %} -{% url 'registration_activate' activation_key as activation_key_url%} +{% url 'django_registration_activate' activation_key as activation_key_url%} {% blocktrans with sitename=site.name siteurl=site.domain %} You (or someone pretending to be you) have asked to register an account at {{ sitename }}. If this wasn't you, please ignore this email and your address will be removed from our records. -To activate this account, please click the following link within the next +To activate this account, please click the following link within the next {{ expiration_days }} days: http://{{ siteurl }}{{ activation_key_url }} Sincerely, {{ sitename }} Management -{% endblocktrans %} \ No newline at end of file +{% endblocktrans %} From 447d39390297ed2c27a698e3a14edebaa77ccb8a Mon Sep 17 00:00:00 2001 From: Dan Frankowski Date: Thu, 28 Feb 2019 12:49:54 -0600 Subject: [PATCH 08/13] fix 'logged-out' page and registration link --- .../templates/registration/logged_out.html | 14 ++++++++++++++ .../templates/registration/login.html | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 registration_defaults/templates/registration/logged_out.html diff --git a/registration_defaults/templates/registration/logged_out.html b/registration_defaults/templates/registration/logged_out.html new file mode 100644 index 0000000..f9b51d4 --- /dev/null +++ b/registration_defaults/templates/registration/logged_out.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block title %}Logged out{% endblock %} + +{% block content %} + +

{% trans "Thanks for spending some quality time with the website today." %}

+ +

{% trans 'Return to the home page' %}

+ +

{% trans 'Log in again' %}

+ +{% endblock %} diff --git a/registration_defaults/templates/registration/login.html b/registration_defaults/templates/registration/login.html index 2ec2f39..f2ef8c3 100644 --- a/registration_defaults/templates/registration/login.html +++ b/registration_defaults/templates/registration/login.html @@ -3,9 +3,10 @@ {% block title %}{% trans "Login" %}{% endblock %} {% block content %} {% url 'password_reset' as auth_pwd_reset_url %} -{% url 'registration_register' as register_url%} +{% url 'django_registration_register' as register_url%} {% if form.errors %} +{# TODO: get the real form error #}

{% blocktrans %}Your username and password didn't match. Please try again.{% endblocktrans %}

{% endif %} From 698f8837538c3666c7fa39500924aa7bcc3358b8 Mon Sep 17 00:00:00 2001 From: Dan Frankowski Date: Wed, 21 Aug 2019 16:46:45 -0500 Subject: [PATCH 09/13] ignore .idea --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 41969a4..5401dde 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ build/ .DS_Store MANIFEST dist +.idea From 2e4fe8b2b8b572d9956c85654215c16a00f8963b Mon Sep 17 00:00:00 2001 From: Dan Frankowski Date: Wed, 21 Aug 2019 16:48:03 -0500 Subject: [PATCH 10/13] Add registration_closed.html --- .../templates/django_registration/registration_closed.html | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 registration_defaults/templates/django_registration/registration_closed.html diff --git a/registration_defaults/templates/django_registration/registration_closed.html b/registration_defaults/templates/django_registration/registration_closed.html new file mode 100644 index 0000000..dfe2197 --- /dev/null +++ b/registration_defaults/templates/django_registration/registration_closed.html @@ -0,0 +1,6 @@ +{% extends "django_registration/registration_base.html" %} +{% load i18n %} +{% block title %}{% trans "Registration closed" %}{% endblock %} +{% block content %} +{% blocktrans %}Registration is closed for this site.{% endblocktrans %} +{% endblock %} From ce77694d25404212d28e086390359e8bc328cd06 Mon Sep 17 00:00:00 2001 From: Dan Frankowski Date: Wed, 21 Aug 2019 16:58:50 -0500 Subject: [PATCH 11/13] increment version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 51390a0..0281533 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from distutils.core import setup -VERSION = '0.4.5' +VERSION = '0.4.6' setup( name='django-registration-defaults', From fa9569c82396b5affd3222c003da0b93c3dc4b16 Mon Sep 17 00:00:00 2001 From: Dan Frankowski Date: Wed, 21 Aug 2019 17:35:58 -0500 Subject: [PATCH 12/13] Respect REGISTRATION_OPEN and get real form errors --- .../templates/registration/login.html | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/registration_defaults/templates/registration/login.html b/registration_defaults/templates/registration/login.html index f2ef8c3..8b510fe 100644 --- a/registration_defaults/templates/registration/login.html +++ b/registration_defaults/templates/registration/login.html @@ -6,8 +6,18 @@ {% url 'django_registration_register' as register_url%} {% if form.errors %} -{# TODO: get the real form error #} -

{% blocktrans %}Your username and password didn't match. Please try again.{% endblocktrans %}

+ {% for field in form %} + {% for error in field.errors %} +
  • {% blocktrans %}{{ error }}{% endblocktrans %}
  • + {% endfor %} + {% endfor %} + {% if form.non_field_errors %} +
      + {% for error in form.non_field_errors %} +
    • {% blocktrans %}{{ error }}{% endblocktrans %}
    • + {% endfor %} +
    + {% endif %} {% endif %} {% csrf_token %} @@ -21,11 +31,14 @@
    {% trans form.username.label_tag %}{{ form.password }}
    -

    {% blocktrans %}Forgot your password? - Need an account?{% endblocktrans %}

    +

    {% blocktrans %}Forgot your password?{% endblocktrans %} +{% if settings.REGISTRATION_OPEN %} + {% blocktrans %}Need an account?{% endblocktrans %}

    +{% endif %} + {% endblock %} From e5539d5ffe477a073ec9b4b60929f5efd84ea1e1 Mon Sep 17 00:00:00 2001 From: Dan Frankowski Date: Wed, 21 Aug 2019 18:07:05 -0500 Subject: [PATCH 13/13] comment and formatting --- registration_defaults/templates/registration/login.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/registration_defaults/templates/registration/login.html b/registration_defaults/templates/registration/login.html index 8b510fe..e816287 100644 --- a/registration_defaults/templates/registration/login.html +++ b/registration_defaults/templates/registration/login.html @@ -36,9 +36,11 @@ -

    {% blocktrans %}Forgot your password?{% endblocktrans %} +

    {% blocktrans %}Forgot your password?{% endblocktrans %}

    +{# NOTE: settings is not put into the template by default, you have to override the login view with extra_context #} +{# See https://docs.djangoproject.com/en/2.2/topics/auth/default/#django.contrib.auth.views.LoginView #} {% if settings.REGISTRATION_OPEN %} - {% blocktrans %}Need an account?{% endblocktrans %}

    +

    {% blocktrans %}Need an account?{% endblocktrans %}

    {% endif %} {% endblock %}