Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ build/
.DS_Store
MANIFEST
dist
.idea
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
django-registration-defaults
============================

James Bennet's `django-registration <http://bitbucket.org/ubernostrum/django-registration/>`_
James Bennet's `django-registration <http://bitbucket.org/ubernostrum/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
Expand Down Expand Up @@ -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
Expand All @@ -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
<http://django-reusable-app-docs.readthedocs.org/en/latest/index.html>`_ ). For example::

<!doctype html>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{% extends "registration/registration_base.html" %}
{% extends "django_registration/registration_base.html" %}
{% 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 <a href='{{ auth_login_url }}'>login</a> using the username and password you set at registration.
{% endblocktrans %}
{% endblock %}


Original file line number Diff line number Diff line change
@@ -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 %}
{% endblocktrans %}
Original file line number Diff line number Diff line change
@@ -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 %}
Original file line number Diff line number Diff line change
@@ -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 %}
Original file line number Diff line number Diff line change
@@ -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 %}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 %}
Expand Down
14 changes: 0 additions & 14 deletions registration_defaults/templates/registration/activate.html

This file was deleted.

26 changes: 0 additions & 26 deletions registration_defaults/templates/registration/activation_email.html

This file was deleted.

14 changes: 14 additions & 0 deletions registration_defaults/templates/registration/logged_out.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% extends "base.html" %}
{% load i18n %}

{% block title %}Logged out{% endblock %}

{% block content %}

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

<p><a href="{% url 'index' %}">{% trans 'Return to the home page' %}</a></p>

<p><a href="{% url 'login' %}">{% trans 'Log in again' %}</a></p>

{% endblock %}
30 changes: 23 additions & 7 deletions registration_defaults/templates/registration/login.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
{% extends "registration/registration_base.html" %}
{% extends "django_registration/registration_base.html" %}
{% load i18n %}
{% block title %}{% trans "Login" %}{% endblock %}
{% block content %}
{% url 'auth_password_reset' as auth_pwd_reset_url %}
{% url 'registration_register' as register_url%}
{% url 'password_reset' as auth_pwd_reset_url %}
{% url 'django_registration_register' as register_url%}

{% if form.errors %}
<p>{% blocktrans %}Your username and password didn't match. Please try again.{% endblocktrans %}</p>
{% for field in form %}
{% for error in field.errors %}
<li>{% blocktrans %}{{ error }}{% endblocktrans %}</li>
{% endfor %}
{% endfor %}
{% if form.non_field_errors %}
<ul class="errorlist nonfield">
{% for error in form.non_field_errors %}
<li>{% blocktrans %}{{ error }}{% endblocktrans %}</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}

<form method="post" action="{% url 'auth_login' %}">{% csrf_token %}
<form method="post" action="{% url 'login' %}">{% csrf_token %}
<table>
<tr>
<td>{% trans form.username.label_tag %}</td>
Expand All @@ -20,11 +31,16 @@
<td>{{ form.password }}</td>
</tr>
</table>
<p>{% blocktrans %}<a href="{{ auth_pwd_reset_url }}">Forgot</a> your password?
<a href="{{ register_url }}">Need an account</a>?{% endblocktrans %}</p>

<input type="submit" value="{% trans "login" %}" />
<input type="hidden" name="next" value="{{ next }}" />
</form>

<p>{% blocktrans %}<a href="{{ auth_pwd_reset_url }}">Forgot your password?</a>{% endblocktrans %}</p>
{# 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 %}
<p>{% blocktrans %}<a href="{{ register_url }}">Need an account</a>?{% endblocktrans %}</p>
{% endif %}

{% endblock %}
2 changes: 1 addition & 1 deletion registration_defaults/templates/registration/logout.html
Original file line number Diff line number Diff line change
@@ -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 %}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 %}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 %}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 %}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 %}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 %}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 %}
{% endblocktrans %}
Original file line number Diff line number Diff line change
@@ -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 %}
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from distutils.core import setup

VERSION = '0.4.4'
VERSION = '0.4.6'

setup(
name='django-registration-defaults',
Expand All @@ -13,7 +13,7 @@
" on ``django-registration``.",
author="Charlie DeTar",
author_email="[email protected]",
url="http://github.com/yourcelf/django-registration-defaults",
url="http://github.com/dfrankow/django-registration-defaults",
license="MIT License",
platforms=["any"],
classifiers=[
Expand All @@ -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'},
Expand Down