├── registration_email ├── models.py ├── backends │ ├── __init__.py │ ├── default │ │ ├── __init__.py │ │ └── urls.py │ └── simple │ │ ├── __init__.py │ │ └── urls.py ├── __init__.py ├── static │ └── registration_email │ │ └── css │ │ └── auth.css ├── templates │ └── registration │ │ ├── activation_email_subject.txt │ │ ├── registration_base.html │ │ ├── logout.html │ │ ├── password_reset_done.html │ │ ├── password_reset_complete.html │ │ ├── activate.html │ │ ├── password_change_done.html │ │ ├── registration_complete.html │ │ ├── registration_closed.html │ │ ├── activation_email.txt │ │ ├── activation_complete.html │ │ ├── password_reset_email.html │ │ ├── registration_form.html │ │ ├── password_reset_form.html │ │ ├── password_change_form.html │ │ ├── password_reset_confirm.html │ │ └── login.html ├── locale │ ├── nl │ │ └── LC_MESSAGES │ │ │ ├── django.mo │ │ │ └── django.po │ └── pl │ │ └── LC_MESSAGES │ │ ├── django.mo │ │ └── django.po ├── views.py ├── auth.py ├── auth_urls.py └── forms.py ├── .gitignore ├── DESCRIPTION ├── MANIFEST.in ├── AUTHORS ├── setup.py ├── LICENSE ├── CHANGELOG.txt └── README.md /registration_email/models.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /registration_email/backends/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /registration_email/backends/default/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /registration_email/backends/simple/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | build/ 3 | dist/ 4 | *egg-info/ 5 | 6 | -------------------------------------------------------------------------------- /registration_email/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | __version__ = '0.10' 3 | -------------------------------------------------------------------------------- /registration_email/static/registration_email/css/auth.css: -------------------------------------------------------------------------------- 1 | #id_your_name, label[for="id_your_name"] {display: none;} -------------------------------------------------------------------------------- /registration_email/templates/registration/activation_email_subject.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {{ site.name }} {% trans "Account Request" %} 3 | -------------------------------------------------------------------------------- /registration_email/locale/nl/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitlabstudio/django-registration-email/HEAD/registration_email/locale/nl/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /registration_email/locale/pl/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitlabstudio/django-registration-email/HEAD/registration_email/locale/pl/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Provides a custom authentication backend so that users can signup to the site via their email address instead of a username. Also provides a set of standard templates and sane URL mappings for the whole registration workflow. 2 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include AUTHORS 2 | include LICENSE 3 | include DESCRIPTION 4 | include CHANGELOG.txt 5 | include README.md 6 | recursive-include registration_email *.py *.txt *.html *.mo *.po *.css 7 | prune registration_email/.ropeproject 8 | exclude *.orig *.pyc 9 | -------------------------------------------------------------------------------- /registration_email/templates/registration/registration_base.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load url from future %} 3 | {% load i18n %} 4 | 5 | {% block extracss %} 6 | {{ form.media.css }} 7 | {% endblock %} 8 | 9 | {% block main %} 10 | {% block masthead %}{% endblock %} 11 | {% block content %}{% endblock %} 12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Current or previous core committers 2 | 3 | * Martin Brochhaus 4 | 5 | Contributors (in alphabetical order) 6 | 7 | * Alper Cugun (alper) 8 | * Brian Thorne 9 | * Emiliano Dalla Verde Marcozzi (edvm) 10 | * Gijs Nijholt 11 | * Julien Poissonnier (julienp) 12 | * Kars (kaeru) 13 | * Mystic-Mirage 14 | * nanthony 15 | * Pascal Jürgens (trifle) 16 | * Viator (viatoriche) 17 | -------------------------------------------------------------------------------- /registration_email/templates/registration/logout.html: -------------------------------------------------------------------------------- 1 | {% extends "registration/registration_base.html" %} 2 | {% load url from future %} 3 | {% load i18n %} 4 | 5 | {% block title %}{% trans "Logout" %}{% endblock %} 6 | 7 | {% block masthead %} 8 |

{% trans "Logout" %}

9 | {% endblock %} 10 | 11 | {% block content %} 12 |

{% trans "You have been logged out." %}

13 | {% endblock %} 14 | -------------------------------------------------------------------------------- /registration_email/views.py: -------------------------------------------------------------------------------- 1 | """Views for the registration_email app.""" 2 | from django.contrib.auth.views import login 3 | 4 | 5 | def login_remember_me(request, *args, **kwargs): 6 | """Custom login view that enables "remember me" functionality.""" 7 | if request.method == 'POST': 8 | if not request.POST.get('remember_me', None): 9 | request.session.set_expiry(0) 10 | return login(request, *args, **kwargs) 11 | -------------------------------------------------------------------------------- /registration_email/templates/registration/password_reset_done.html: -------------------------------------------------------------------------------- 1 | {% extends "registration/registration_base.html" %} 2 | {% load url from future %} 3 | {% load i18n %} 4 | 5 | {% block title %}{% trans "Password reset successful" %}{% endblock %} 6 | 7 | {% block masthead %} 8 |

{% trans "Password reset successful" %}

9 | {% endblock %} 10 | 11 | {% block content %} 12 |

{% trans "We have sent you instructions for setting your password." %}

13 | {% endblock %} 14 | -------------------------------------------------------------------------------- /registration_email/templates/registration/password_reset_complete.html: -------------------------------------------------------------------------------- 1 | {% extends "registration/registration_base.html" %} 2 | {% load url from future %} 3 | {% load i18n %} 4 | 5 | {% block title %}{% trans "Password reset complete" %}{% endblock %} 6 | 7 | {% block masthead %} 8 |

{% trans "Password reset complete" %}

9 | {% endblock %} 10 | 11 | {% block content %} 12 |

{% trans "Please login with your new password." %}

13 | {% trans "Login" %} 14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /registration_email/templates/registration/activate.html: -------------------------------------------------------------------------------- 1 | {% extends "registration/registration_base.html" %} 2 | {% load url from future %} 3 | {% load i18n %} 4 | 5 | {% block title %}{% trans "Activation failure" %}{% endblock %} 6 | 7 | {% block masthead %} 8 |

{% trans "Activation failure" %}

9 | {% endblock %} 10 | 11 | {% block content %} 12 |

{% trans "We are sorry but something went wrong!" %}

13 |

{% trans "The activation link you provided is broken or was already used." %}

14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /registration_email/templates/registration/password_change_done.html: -------------------------------------------------------------------------------- 1 | {% extends "registration/registration_base.html" %} 2 | {% load url from future %} 3 | {% load i18n %} 4 | 5 | {% block title %}{% trans "Password change successful" %}{% endblock %} 6 | 7 | {% block masthead %} 8 |

{% trans "Password change successful" %}

9 | {% endblock %} 10 | 11 | {% block content %} 12 |

{% trans "Your password has been changed." %}

13 | {% trans "Back to dashboard" %} 14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /registration_email/templates/registration/registration_complete.html: -------------------------------------------------------------------------------- 1 | {% extends "registration/registration_base.html" %} 2 | {% load url from future %} 3 | {% load i18n %} 4 | 5 | {% block title %}{% trans "Registration complete" %}{% endblock %} 6 | 7 | {% block masthead %} 8 |

{% trans "Registration complete" %}

9 | {% endblock %} 10 | 11 | {% block content %} 12 |

{% trans "Thank you for your registration!" %}

13 |

{% trans "You will receive an email with an activation link shortly." %}

14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /registration_email/templates/registration/registration_closed.html: -------------------------------------------------------------------------------- 1 | {% extends "registration/registration_base.html" %} 2 | {% load url from future %} 3 | {% load i18n %} 4 | 5 | {% block title %}{% trans "Registration closed" %}{% endblock %} 6 | 7 | {% block masthead %} 8 |

{% trans "Registration closed" %}

9 | {% endblock %} 10 | 11 | {% block content %} 12 |

{% trans "We are sorry but registration is temporarily closed." %}

13 |

{% trans "Please come back shortly and try again. We apologize for the inconvenience." %}

14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /registration_email/templates/registration/activation_email.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% load url from future %} 3 | 4 | 5 | {% blocktrans with site.name as site_name %} 6 | You have asked to register an account at {{ site_name }}. 7 | If this wasn't you, please ignore this email. 8 | 9 | To activate this account, please click the following link within the next 10 | {{ expiration_days }} days: 11 | {% endblocktrans %} 12 | 13 | http://{{ site.domain }}{% url "registration_activate" activation_key=activation_key %} 14 | 15 | {% trans "Sincerely," %} 16 | {{ site.name }} 17 | -------------------------------------------------------------------------------- /registration_email/templates/registration/activation_complete.html: -------------------------------------------------------------------------------- 1 | {% extends "registration/registration_base.html" %} 2 | {% load url from future %} 3 | {% load i18n %} 4 | 5 | {% block title %}{% trans "Activation complete" %}{% endblock %} 6 | 7 | {% block masthead %} 8 |

{% trans "Activation complete" %}

9 | {% endblock %} 10 | 11 | {% block content %} 12 |

{% trans "You may now login with your username and password." %}

13 | {% if not user.is_authenticated %} 14 | {% trans "Login now" %} 15 | {% else %} 16 | {% trans "Home" %} 17 | {% endif %} 18 | {% endblock %} 19 | -------------------------------------------------------------------------------- /registration_email/templates/registration/password_reset_email.html: -------------------------------------------------------------------------------- 1 | {% load i18n %}{% load url from future %}{% autoescape off %} 2 | {% blocktrans %}You're receiving this e-mail because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %} 3 | 4 | {% trans "Please go to the following page and choose a new password:" %} 5 | {% block reset_link %} 6 | {{ protocol }}://{{ domain }}{% url 'django.contrib.auth.views.password_reset_confirm' uidb36=uid token=token %} 7 | {% endblock %} 8 | 9 | {% trans "Thanks for using our site!" %} 10 | 11 | {% blocktrans %}The {{ site_name }} team{% endblocktrans %} 12 | 13 | {% endautoescape %} 14 | -------------------------------------------------------------------------------- /registration_email/templates/registration/registration_form.html: -------------------------------------------------------------------------------- 1 | {% extends "registration/registration_base.html" %} 2 | {% load url from future %} 3 | {% load i18n %} 4 | 5 | {% block title %}{% trans "Registration form" %}{% endblock %} 6 | 7 | {% block masthead %} 8 |

{% trans "Registration form" %}

9 | {% endblock %} 10 | 11 | {% block content %} 12 |
13 | {% csrf_token %} 14 | {{ form.non_field_errors }} 15 | {% for field in form %} 16 |
17 | {{ field.errors }} 18 | {{ field.label_tag }} 19 | {{ field }} 20 |
21 | {% endfor %} 22 | 23 |
24 | {% endblock %} 25 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from setuptools import setup, find_packages 4 | 5 | import registration_email 6 | 7 | 8 | def read(fname): 9 | try: 10 | return open(os.path.join(os.path.dirname(__file__), fname)).read() 11 | except IOError: 12 | return '' 13 | 14 | 15 | setup( 16 | name="django-registration-email", 17 | version=registration_email.__version__, 18 | description=read('DESCRIPTION'), 19 | long_description=read('README.md'), 20 | keywords='django, registration, email, backend', 21 | packages=find_packages(), 22 | author='Martin Brochhaus', 23 | author_email='martin.brochhaus@gmail.com', 24 | url="http://github.com/bitmazk/django-registration-email", 25 | include_package_data=True, 26 | test_suite='registration_email.tests.runtests.runtests', 27 | ) 28 | -------------------------------------------------------------------------------- /registration_email/templates/registration/password_reset_form.html: -------------------------------------------------------------------------------- 1 | {% extends "registration/registration_base.html" %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans "Password reset" %}{% endblock %} 5 | 6 | {% block masthead %} 7 |

{% trans "Password reset" %}

8 | {% endblock %} 9 | 10 | {% block content %} 11 |

{% trans "Enter your e-mail address below, and we will send instructions for setting a new one." %}

12 |
13 | {% csrf_token %} 14 | {{ form.non_field_errors }} 15 | {% for field in form %} 16 |
17 | {{ field.errors }} 18 | {{ field.label_tag }} 19 | {{ field }} 20 |
21 | {% endfor %} 22 | 23 |
24 | {% endblock %} 25 | -------------------------------------------------------------------------------- /registration_email/templates/registration/password_change_form.html: -------------------------------------------------------------------------------- 1 | {% extends "registration/registration_base.html" %} 2 | {% load url from future %} 3 | {% load i18n %} 4 | 5 | {% block title %}{% trans "Password change" %}{% endblock %} 6 | 7 | {% block masthead %} 8 |

{% trans "Password change" %}

9 | {% endblock %} 10 | 11 | {% block content %} 12 |

{% trans "Please enter your old password, then enter your new password twice." %}

13 |
14 | {% csrf_token %} 15 | {{ form.non_field_errors }} 16 | {% for field in form %} 17 |
18 | {{ field.errors }} 19 | {{ field.label_tag }} 20 | {{ field }} 21 |
22 | {% endfor %} 23 | 24 |
{% trans "Reset password" %}
25 |
26 | {% endblock %} 27 | -------------------------------------------------------------------------------- /registration_email/templates/registration/password_reset_confirm.html: -------------------------------------------------------------------------------- 1 | {% extends "registration/registration_base.html" %} 2 | {% load url from future %} 3 | {% load i18n %} 4 | 5 | {% block title %} 6 | {% if validlink %}{% trans "Enter new password" %}{% else %}{% trans "Error resetting password" %}{% endif %} 7 | {% endblock %} 8 | 9 | {% block masthead %} 10 | {% if validlink %} 11 |

{% trans "Enter new password" %}

12 | {% else %} 13 |

{% trans "Error resetting password" %}

14 | {% endif %} 15 | {% endblock %} 16 | 17 | {% block content %} 18 | {% if validlink %} 19 |

{% trans "Please enter your new password twice." %}

20 |
21 | {% csrf_token %} 22 | {{ form.non_field_errors }} 23 | {% for field in form %} 24 |
25 | {{ field.errors }} 26 | {{ field.label_tag }} 27 | {{ field }} 28 |
29 | {% endfor %} 30 | 31 |
32 | {% else %} 33 |

{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}

34 | {% endif %} 35 | {% endblock %} 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /registration_email/templates/registration/login.html: -------------------------------------------------------------------------------- 1 | {% extends "registration/registration_base.html" %} 2 | {% load url from future %} 3 | {% load i18n %} 4 | 5 | {% block title %}{% trans "Login" %}{% endblock %} 6 | 7 | {% block masthead %} 8 |

{% trans "Login" %}

9 | {% endblock %} 10 | 11 | {% block content %} 12 |
13 | {% csrf_token %} 14 | {{ form.non_field_errors }} 15 |
16 | {{ form.username.errors }} 17 | 18 | {{ form.username }} 19 |
20 |
21 | {{ form.password.errors }} 22 | {{ form.password.label_tag }} 23 | {{ form.password }} 24 |
25 |
26 | {{ form.remember_me.errors }} 27 | {{ form.remember_me.label_tag }} 28 | {{ form.remember_me }} 29 |
30 | 34 | 35 | 36 |
37 | {% endblock %} 38 | -------------------------------------------------------------------------------- /registration_email/backends/simple/urls.py: -------------------------------------------------------------------------------- 1 | """ 2 | URLconf for registration and activation, using django-registration's 3 | one-step backend. 4 | 5 | If the default behavior of these views is acceptable to you, simply 6 | use a line like this in your root URLconf to set up the default URLs 7 | for registration:: 8 | 9 | (r'^accounts/', include('registration_email.backends.simple.urls')), 10 | 11 | This will also automatically set up the views in 12 | ``django.contrib.auth`` at sensible default locations. 13 | 14 | If you'd like to customize registration behavior, feel free to set up 15 | your own URL patterns for these views instead. 16 | 17 | """ 18 | from django.conf import settings 19 | from django.conf.urls import include, url 20 | from django.views.generic.base import TemplateView 21 | 22 | from registration.backends.simple.views import RegistrationView 23 | from registration_email.forms import EmailRegistrationForm 24 | 25 | 26 | urlpatterns = [ 27 | url(r'^register/$', 28 | RegistrationView.as_view( 29 | form_class=EmailRegistrationForm, 30 | get_success_url=getattr( 31 | settings, 'REGISTRATION_EMAIL_REGISTER_SUCCESS_URL', 32 | lambda request, user: '/'), 33 | ), 34 | name='registration_register'), 35 | url(r'^register/closed/$', 36 | TemplateView.as_view( 37 | template_name='registration/registration_closed.html'), 38 | name='registration_disallowed'), 39 | (r'', include('registration_email.auth_urls')), 40 | ] 41 | -------------------------------------------------------------------------------- /registration_email/auth.py: -------------------------------------------------------------------------------- 1 | """ 2 | Custom authentication backends. 3 | 4 | Inspired by http://djangosnippets.org/snippets/2463/ 5 | 6 | """ 7 | from django.contrib.auth.backends import ModelBackend 8 | from django.core.validators import validate_email 9 | 10 | 11 | try: 12 | from django.contrib.auth import get_user_model 13 | User = get_user_model() 14 | except ImportError: 15 | from django.contrib.auth.models import User 16 | 17 | 18 | class EmailBackend(ModelBackend): 19 | """ 20 | Custom authentication backend that allows to login with an email address. 21 | 22 | """ 23 | 24 | supports_object_permissions = True 25 | supports_anonymous_user = False 26 | supports_inactive_user = False 27 | 28 | def authenticate(self, username=None, password=None): 29 | try: 30 | validate_email(username) 31 | except: 32 | username_is_email = False 33 | else: 34 | username_is_email = True 35 | if username_is_email: 36 | try: 37 | user = User.objects.get(email=username) 38 | except User.DoesNotExist: 39 | return None 40 | else: 41 | # We have a non-email address username we should try username 42 | try: 43 | user = User.objects.get(username=username) 44 | except User.DoesNotExist: 45 | return None 46 | if user.check_password(password): 47 | return user 48 | return None 49 | 50 | def get_user(self, user_id): 51 | try: 52 | return User.objects.get(pk=user_id) 53 | except User.DoesNotExist: 54 | return None 55 | -------------------------------------------------------------------------------- /registration_email/backends/default/urls.py: -------------------------------------------------------------------------------- 1 | """Custom urls.py for django-registration.""" 2 | from django.conf import settings 3 | from django.conf.urls import include, url 4 | from django.views.generic import TemplateView 5 | 6 | from registration.backends.default.views import ( 7 | ActivationView, 8 | RegistrationView, 9 | ) 10 | from registration_email.forms import EmailRegistrationForm 11 | 12 | 13 | urlpatterns = [ 14 | # django-registration views 15 | url(r'^activate/complete/$', 16 | TemplateView.as_view( 17 | template_name='registration/activation_complete.html'), 18 | name='registration_activation_complete'), 19 | url(r'^activate/(?P\w+)/$', 20 | ActivationView.as_view( 21 | template_name='registration/activate.html', 22 | get_success_url=getattr( 23 | settings, 'REGISTRATION_EMAIL_ACTIVATE_SUCCESS_URL', 24 | lambda request, user: '/'), 25 | ), 26 | name='registration_activate'), 27 | url(r'^register/$', 28 | RegistrationView.as_view( 29 | form_class=EmailRegistrationForm, 30 | get_success_url=getattr( 31 | settings, 'REGISTRATION_EMAIL_REGISTER_SUCCESS_URL', 32 | lambda request, user: '/'), 33 | ), 34 | name='registration_register'), 35 | url(r'^register/complete/$', 36 | TemplateView.as_view( 37 | template_name='registration/registration_complete.html'), 38 | name='registration_complete'), 39 | url(r'^register/closed/$', 40 | TemplateView.as_view( 41 | template_name='registration/registration_closed.html'), 42 | name='registration_disallowed'), 43 | 44 | # django auth urls 45 | url(r'', include('registration_email.auth_urls')), 46 | ] 47 | -------------------------------------------------------------------------------- /registration_email/auth_urls.py: -------------------------------------------------------------------------------- 1 | """ 2 | Re-definition of Django's auth URLs. 3 | 4 | This is done for convenience. It allows us to save all registration and auth 5 | related templates in the same `/templates/registration/` folder. 6 | 7 | """ 8 | from django.conf.urls import url 9 | from django.contrib.auth import views as auth_views 10 | from registration_email.forms import EmailAuthenticationForm 11 | 12 | from .views import login_remember_me 13 | 14 | 15 | urlpatterns = [ 16 | url( 17 | r'^login/$', 18 | login_remember_me, 19 | {'template_name': 'registration/login.html', 20 | 'authentication_form': EmailAuthenticationForm, }, 21 | name='auth_login', 22 | ), 23 | url( 24 | r'^logout/$', 25 | auth_views.logout, 26 | {'template_name': 'registration/logout.html'}, 27 | name='auth_logout', 28 | ), 29 | url( 30 | r'^password/change/$', 31 | auth_views.password_change, 32 | {'template_name': 'registration/password_change_form_custom.html'}, 33 | name='password_change', 34 | ), 35 | url( 36 | r'^password/change/done/$', 37 | auth_views.password_change_done, 38 | {'template_name': 'registration/password_change_done_custom.html'}, 39 | name='password_change_done', 40 | # must be named like this because get's reversed in Django views.py 41 | ), 42 | url( 43 | r'^password/reset/$', 44 | auth_views.password_reset, 45 | {'template_name': 'registration/password_reset_form.html'}, 46 | name='password_reset', 47 | ), 48 | url( 49 | r'^password/reset/confirm/(?P[0-9A-Za-z]+)-(?P.+)/$', 50 | auth_views.password_reset_confirm, 51 | {'template_name': 'registration/password_reset_confirm.html'}, 52 | name='password_reset_confirm', 53 | ), 54 | url( 55 | r'^password/reset/complete/$', 56 | auth_views.password_reset_complete, 57 | {'template_name': 'registration/password_reset_complete.html'}, # NOQA 58 | name='password_reset_complete', 59 | ), 60 | url( 61 | r'^password/reset/done/$', 62 | auth_views.password_reset_done, 63 | {'template_name': 'registration/password_reset_done.html'}, 64 | name='password_reset_done', 65 | ), 66 | ] 67 | -------------------------------------------------------------------------------- /CHANGELOG.txt: -------------------------------------------------------------------------------- 1 | === 0.10.X (to be released as 0.11) === 2 | 3 | === 0.10 === 4 | 5 | - Updated urls.py to be compatible with recent Django versions ( 6 | no longer using `patterns`) 7 | 8 | === 0.9 === 9 | 10 | - Fixed all auth_urls - we have to keep the original URL names because Django 11 | uses them internally. You might want to search for `auth_` in your templates 12 | and only keep it for `auth_login` and `auth_logout` but remove it from the 13 | other URLs 14 | 15 | === 0.8 === 16 | 17 | - Fixed password_change_done URL name 18 | 19 | === 0.7.2 === 20 | 21 | - Prepared for Python 3 and fixed email validator import 22 | 23 | === 0.7.1 === 24 | 25 | - Added title block to all templates 26 | 27 | === 0.7 === 28 | 29 | - Added login_remember_me view function 30 | - Added remember_me field to EmailLoginForm 31 | 32 | === 0.6 === 33 | 34 | - Changed URL settings due to misuse of get_success_url function in 35 | django-registration app 36 | - updated to support django-registration's new class based views 37 | 38 | === 0.5.4 === 39 | 40 | - updated Manifest.in to include missing style sheet 41 | 42 | === 0.5.3 === 43 | 44 | - stripping whitespace from email string in registration form 45 | 46 | === 0.5.2 === 47 | 48 | - Changed deprecated import 49 | 50 | === 0.5.1 === 51 | 52 | - using hashlib instead of deprecated md5 module 53 | 54 | === 0.5 === 55 | 56 | - Added dutch translation 57 | 58 | === 0.4.1 === 59 | 60 | - Fixed a bad

tag 61 | 62 | === 0.4 === 63 | 64 | - Added registration_base.html template. 65 | 66 | === 0.3 === 67 | 68 | - making sure to save emails as lower case all the time 69 | 70 | === 0.2.4 === 71 | 72 | - BUGFIX!! Fixed typo in urls.py. Thanks to `DmitryGit` for reporting this! 73 | 74 | === 0.2.3 === 75 | 76 | - Replaced usage of `direct_to_template` with `TemplateView` because the former 77 | doesn't exist in Django 1.5 any more. 78 | 79 | === 0.2.2 === 80 | 81 | - made username generation more robust to avoid name clashes 82 | 83 | === 0.2.1 === 84 | 85 | - Added method `generate_username` in `forms.py` so you can re-use it in your 86 | own apps. 87 | 88 | === 0.2.0 === 89 | 90 | - Added new settings: REGISTRATION_EMAIL_REGISTER_SUCCESS_URL and 91 | REGISTRATION_EMAIL_ACTIVATE_SUCCESS_URL. This allows to override the standard 92 | redirect without overriding the urls.py. 93 | 94 | === 0.1.0 === 95 | 96 | - Added URLs for the simple backend of django-registration. 97 | 98 | === 0.0.1 === 99 | 100 | - Initial commit 101 | -------------------------------------------------------------------------------- /registration_email/forms.py: -------------------------------------------------------------------------------- 1 | """Custom registration forms that expects an email address as a username.""" 2 | import hashlib 3 | import os 4 | 5 | from django import forms 6 | from django.conf import settings 7 | from django.contrib.auth.forms import AuthenticationForm 8 | from django.contrib.auth.models import User 9 | from django.utils.translation import ugettext_lazy as _ 10 | 11 | 12 | try: 13 | from django.contrib.auth import get_user_model 14 | User = get_user_model() 15 | except ImportError: 16 | from django.contrib.auth.models import User 17 | 18 | # I put this on all required fields, because it's easier to pick up 19 | # on them with CSS or JavaScript if they have a class of "required" 20 | # in the HTML. Your mileage may vary. If/when Django ticket #3515 21 | # lands in trunk, this will no longer be necessary. 22 | attrs_dict = {'class': 'required'} 23 | 24 | 25 | def get_md5_hexdigest(email): 26 | """ 27 | Returns an md5 hash for a given email. 28 | 29 | The length is 30 so that it fits into Django's ``User.username`` field. 30 | 31 | """ 32 | if isinstance(email, str): # for py3 33 | email = email.encode('utf-8') 34 | return hashlib.md5(email).hexdigest()[0:30] 35 | 36 | 37 | def generate_username(email): 38 | """ 39 | Generates a unique username for the given email. 40 | 41 | The username will be an md5 hash of the given email. If the username exists 42 | we just append `a` to the email until we get a unique md5 hash. 43 | 44 | """ 45 | try: 46 | User.objects.get(email=email) 47 | raise Exception('Cannot generate new username. A user with this email' 48 | 'already exists.') 49 | except User.DoesNotExist: 50 | pass 51 | 52 | username = get_md5_hexdigest(email) 53 | found_unique_username = False 54 | while not found_unique_username: 55 | try: 56 | User.objects.get(username=username) 57 | email = '{0}a'.format(email.lower()) 58 | username = get_md5_hexdigest(email) 59 | except User.DoesNotExist: 60 | found_unique_username = True 61 | return username 62 | 63 | 64 | class EmailAuthenticationForm(AuthenticationForm): 65 | remember_me = forms.BooleanField( 66 | required=False, 67 | label=_('Remember me'), 68 | ) 69 | 70 | def __init__(self, *args, **kwargs): 71 | super(EmailAuthenticationForm, self).__init__(*args, **kwargs) 72 | self.fields['username'] = forms.CharField( 73 | label=_("Email"), max_length=256) 74 | 75 | def clean_username(self): 76 | """Prevent case-sensitive erros in email/username.""" 77 | return self.cleaned_data['username'].lower() 78 | 79 | 80 | class EmailRegistrationForm(forms.Form): 81 | """ 82 | Form for registering a new user account. 83 | 84 | Validates that the requested username is not already in use, and 85 | requires the password to be entered twice to catch typos. 86 | 87 | Subclasses should feel free to add any additional validation they 88 | need, but should avoid defining a ``save()`` method -- the actual 89 | saving of collected user data is delegated to the active 90 | registration backend. 91 | 92 | """ 93 | email = forms.EmailField( 94 | widget=forms.TextInput(attrs=dict(attrs_dict, maxlength=256)), 95 | label=_("Email") 96 | ) 97 | password1 = forms.CharField( 98 | widget=forms.PasswordInput(attrs=attrs_dict, render_value=False), 99 | label=_("Password") 100 | ) 101 | password2 = forms.CharField( 102 | widget=forms.PasswordInput(attrs=attrs_dict, render_value=False), 103 | label=_("Password (repeat)")) 104 | your_name = forms.CharField(required=False) 105 | 106 | def clean_email(self): 107 | """ 108 | Validate that the username is alphanumeric and is not already 109 | in use. 110 | 111 | """ 112 | email = self.cleaned_data['email'].strip() 113 | try: 114 | User.objects.get(email__iexact=email) 115 | except User.DoesNotExist: 116 | return email.lower() 117 | raise forms.ValidationError( 118 | _('A user with that email already exists.')) 119 | 120 | def clean(self): 121 | """ 122 | Verifiy that the values entered into the two password fields match. 123 | 124 | Note that an error here will end up in ``non_field_errors()`` because 125 | it doesn't apply to a single field. 126 | 127 | """ 128 | data = self.cleaned_data 129 | if data.get('your_name'): 130 | # Bot protection. The name field is not visible for human users. 131 | raise forms.ValidationError(_('Please enter a valid name.')) 132 | if not 'email' in data: 133 | return data 134 | if ('password1' in data and 'password2' in data): 135 | 136 | if data['password1'] != data['password2']: 137 | raise forms.ValidationError( 138 | _("The two password fields didn't match.")) 139 | 140 | self.cleaned_data['username'] = generate_username(data['email']) 141 | return self.cleaned_data 142 | 143 | class Media: 144 | css = { 145 | 'all': (os.path.join( 146 | settings.STATIC_URL, 'registration_email/css/auth.css'), ) 147 | } 148 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Important 2 | ========= 3 | 4 | This app has been discontinued due to the give-up of django-registration. Also there are a lot of well developed and more extensive alternatives on the market. 5 | 6 | Why don't you check out ``django-allauth``: https://github.com/pennersr/django-allauth 7 | 8 | It's already integrated in our project template (incl. templates & settings): https://github.com/bitmazk/django-project-template/ 9 | It's configured the way we used this app. 10 | 11 | django-registration-email 12 | ========================== 13 | 14 | We use 15 | [django-registration](https://bitbucket.org/ubernostrum/django-registration/overview) 16 | in almost all our projects. However, we don't like Django's limited username 17 | and would like to allow our users to sign up via email. 18 | 19 | This project provides a custom authentication backend which allows users to 20 | authenticate via email. We also provide an EmailRegistrationForm which 21 | checks if an email has already been taken. 22 | 23 | Since we still have to store a username and since emails can easily be longer 24 | than 30 characters, the username will be computed as a md5 hexdigest of the 25 | email address. 26 | 27 | We included a ``urls.py`` that overrides all URLs of django-registration 28 | and Django's auth with a clean and sane structure and you will find a default 29 | set of all necessary templates. 30 | 31 | Usage 32 | ====== 33 | 34 | Install this package:: 35 | 36 | pip install -e git://github.com/bitmazk/django-registration-email#egg=registration_email 37 | 38 | Add ``registration`` and ``registration_email`` to your ``INSTALLED_APPS``:: 39 | 40 | INSTALLED_APPS = [ 41 | # all your other apps 42 | 'registration', 43 | 'registration_email', 44 | ] 45 | 46 | Update your ``urls.py``:: 47 | 48 | url(r'^accounts/', include('registration_email.backends.default.urls')), 49 | 50 | Add some settings to your ``settings.py``:: 51 | 52 | ACCOUNT_ACTIVATION_DAYS = 7 53 | AUTHENTICATION_BACKENDS = ( 54 | 'registration_email.auth.EmailBackend', 55 | ) 56 | LOGIN_REDIRECT_URL = '/' 57 | 58 | Run ``syncdb``:: 59 | 60 | ./manage.py syncdb 61 | 62 | Settings 63 | ======== 64 | 65 | django-registration-email introduces a new setting: 66 | 67 | REGISTRATION_EMAIL_ACTIVATE_SUCCESS_URL 68 | --------------------------------------- 69 | 70 | Default: ``lambda request, user: '/'`` 71 | 72 | Function to return the URL to redirect to after a successful account 73 | activation. If you leave this at ``lambda request, user: '/'`` it will direct 74 | to your base URL. 75 | 76 | REGISTRATION_EMAIL_REGISTER_SUCCESS_URL 77 | --------------------------------------- 78 | 79 | Default: ``lambda request, user: '/'`` 80 | 81 | Function to return the URL to redirect to after a successful account 82 | registration. If you leave this at ``lambda request, user: '/'`` it will direct 83 | to your base URL. 84 | 85 | How to use a custom form 86 | ======================== 87 | 88 | Let's say you want to collect the user's first name and last name when he 89 | registers. In order to achieve that, you need to do the following: 90 | 91 | __1. Create a custom form__ 92 | 93 | Create a new app `my_registration` in your project and give it a `forms.py` 94 | where you override our `EmailRegistrationForm` and your desired extra 95 | fields: 96 | 97 | from django import forms 98 | from registration_email.forms import EmailRegistrationForm 99 | 100 | class CustomEmailRegistrationForm(EmailRegistrationForm): 101 | first_name = forms.CharField() 102 | last_name = forms.CharField() 103 | 104 | Do NOT override the form's `save()` method. 105 | 106 | __2. Override the URL__ 107 | 108 | Now you need to tell the registration view that it is supposed to use the 109 | custom form: 110 | 111 | # your main urls.py 112 | ... 113 | from django.conf import settings 114 | from registration.backends.simple.views import RegistrationView 115 | from my_registration.forms import CustomEmailRegistrationForm 116 | 117 | urlpatterns = [ 118 | ... 119 | url( 120 | r'^accounts/register/$', 121 | RegistrationView.as_view( 122 | template_name='registration/registration_form.html', 123 | form_class=CustomEmailRegistrationForm, 124 | get_success_url=getattr( 125 | settings, 'REGISTRATION_EMAIL_REGISTER_SUCCESS_URL', 126 | lambda request, user: '/'), 127 | ), 128 | name='registration_register', 129 | ), 130 | 131 | url(r'^accounts/', include('registration_email.backends.default.urls')), 132 | ... 133 | ] 134 | 135 | __3. Create a signal handler__ 136 | 137 | In the `urls.py` above I'm using the `SimpleBackend`. When you have a look 138 | at that [backend](https://github.com/nathanborror/django-registration/blob/master/registration/backends/simple/__init__.py#L30) 139 | you will see that the backend sends a signal after creating and logging in the 140 | user. The signal will get all parameters that we need in order to access the 141 | data that has been validated and sent by the form, so let's build a signal 142 | handler: 143 | 144 | # in my_registration.models.py 145 | from django.dispatch import receiver 146 | from registration.signals import user_registered 147 | 148 | @receiver(user_registered) 149 | def user_registered_handler(sender, user, request, **kwargs): 150 | user.first_name = request.POST.get('first_name') 151 | user.last_name = request.POST.get('last_name') 152 | user.save() 153 | 154 | This method has the drawback that you save the user two times in a row. If 155 | you have concerns about performance you would have to create your own 156 | `my_registration.backends.CustomRegistrationBackend` class. That class would 157 | inherit `registration.backends.simple.SimpleBackend` and override the 158 | `register` method. 159 | 160 | But really, we are talking about registration here, I can't imagine how saving 161 | the user twice could do any harm. 162 | 163 | 164 | Troubleshooting 165 | ================ 166 | 167 | If you had another value for ``AUTHENTICATION_BACKENDS`` in your 168 | ``settings.py`` before it might be that it is saved in your ``django_session`` 169 | table. I found no other way around this than to delete the rows in that table. 170 | 171 | TODO 172 | ===== 173 | 174 | * Password reset link points to original django template 175 | -------------------------------------------------------------------------------- /registration_email/locale/nl/LC_MESSAGES/django.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2013-03-01 13:35+0100\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: Alper Cugun \n" 14 | "Language-Team: LANGUAGE \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=2; plural=(n != 1)\n" 19 | 20 | #: forms.py:58 forms.py:76 templates/registration/login.html:15 21 | msgid "Email" 22 | msgstr "E-mail" 23 | 24 | #: forms.py:80 25 | msgid "Password" 26 | msgstr "Wachtwoord" 27 | 28 | #: forms.py:84 29 | msgid "Password (repeat)" 30 | msgstr "Wachtwoord (nog een keer)" 31 | 32 | #: forms.py:98 33 | msgid "A user with that email already exists." 34 | msgstr "Een gebruiker met dat e-mailadres bestaat al." 35 | 36 | #: forms.py:115 37 | msgid "The two password fields didn't match." 38 | msgstr "De twee wachtwoord-velden komen niet overeen." 39 | 40 | #: templates/registration/activate.html:6 41 | msgid "Activation failure" 42 | msgstr "Activatie mislukt" 43 | 44 | #: templates/registration/activate.html:10 45 | msgid "We are sorry but something went wrong!" 46 | msgstr "Tot onze spijt is er iets misgegaan." 47 | 48 | #: templates/registration/activate.html:11 49 | msgid "The activation link you provided is broken or was already used." 50 | msgstr "De activatie-link is al gebruikt of heeft een ander mankement." 51 | 52 | #: templates/registration/activation_complete.html:6 53 | msgid "Activation complete" 54 | msgstr "Activatie voltooid" 55 | 56 | #: templates/registration/activation_complete.html:10 57 | msgid "You may now login with your username and password." 58 | msgstr "Je kunt nu inloggen met je gebruikersnaam en wachtwoord." 59 | 60 | #: templates/registration/activation_complete.html:12 61 | msgid "Login now" 62 | msgstr "Log nu in" 63 | 64 | #: templates/registration/activation_complete.html:14 65 | msgid "Home" 66 | msgstr "Home" 67 | 68 | #: templates/registration/activation_email.txt:5 69 | #, python-format 70 | msgid "" 71 | "\n" 72 | "You have asked to register an account at %(site_name)s.\n" 73 | "If this wasn't you, please ignore this email.\n" 74 | "\n" 75 | "To activate this account, please click the following link within the next\n" 76 | "%(expiration_days)s days:\n" 77 | msgstr "" 78 | "\n" 79 | "Je hebt je aangemeld voor een account bij site %(site_name)s.\n" 80 | "Als je dit niet gedaan hebt, kun je deze e-mail negeren." 81 | "\n" 82 | "Klik binnen %(expiration_days)s dagen op de volgende link om\n" 83 | "dit account te activeren:\n" 84 | 85 | #: templates/registration/activation_email.txt:15 86 | msgid "Sincerely," 87 | msgstr "Met vriendelijke groet," 88 | 89 | #: templates/registration/activation_email_subject.txt:2 90 | msgid "Account Request" 91 | msgstr "Accountverzoek" 92 | 93 | #: templates/registration/login.html:6 templates/registration/login.html:28 94 | #: templates/registration/password_reset_complete.html:11 95 | msgid "Login" 96 | msgstr "Log in" 97 | 98 | #: templates/registration/login.html:24 99 | msgid "Forgot your password?" 100 | msgstr "Wachtwoord vergeten?" 101 | 102 | #: templates/registration/login.html:25 103 | msgid "Register a new account" 104 | msgstr "Registreer een nieuw account" 105 | 106 | #: templates/registration/logout.html:6 107 | msgid "Logout" 108 | msgstr "Log uit" 109 | 110 | #: templates/registration/logout.html:10 111 | msgid "You have been logged out." 112 | msgstr "Je bent uitgelogd." 113 | 114 | #: templates/registration/password_change_done.html:6 115 | msgid "Password change successful" 116 | msgstr "Wachtwoord succesvol gewijzigd" 117 | 118 | #: templates/registration/password_change_done.html:10 119 | msgid "Your password has been changed." 120 | msgstr "Je wachtwoord is gewijzigd." 121 | 122 | #: templates/registration/password_change_done.html:11 123 | msgid "Back to dashboard" 124 | msgstr "Terug naar het dashboard" 125 | 126 | #: templates/registration/password_change_form.html:6 127 | msgid "Password change" 128 | msgstr "Wachtwoordwijziging" 129 | 130 | #: templates/registration/password_change_form.html:10 131 | msgid "Please enter your old password, then enter your new password twice." 132 | msgstr "Vul alsjeblieft je oude wachtwoord in en daarna twee keer het nieuwe wachtwoord." 133 | 134 | #: templates/registration/password_change_form.html:21 135 | msgid "Save" 136 | msgstr "Sla op" 137 | 138 | #: templates/registration/password_change_form.html:22 139 | #: templates/registration/password_reset_form.html:20 140 | msgid "Reset password" 141 | msgstr "Reset wachtwoord" 142 | 143 | #: templates/registration/password_reset_complete.html:6 144 | msgid "Password reset complete" 145 | msgstr "Wachtwoord gereset" 146 | 147 | #: templates/registration/password_reset_complete.html:10 148 | msgid "Please login with your new password." 149 | msgstr "Log in met je nieuwe wachtwoord." 150 | 151 | #: templates/registration/password_reset_confirm.html:7 152 | msgid "Enter new password" 153 | msgstr "Voer een nieuw wachtwoord in" 154 | 155 | #: templates/registration/password_reset_confirm.html:9 156 | msgid "Error resetting password" 157 | msgstr "Fout bij het resetten van het wachtwoord" 158 | 159 | #: templates/registration/password_reset_confirm.html:15 160 | msgid "Please enter your new password twice." 161 | msgstr "Vul je nieuwe wachtwoord twee keer in." 162 | 163 | #: templates/registration/password_reset_confirm.html:26 164 | msgid "Change my password" 165 | msgstr "Verander mijn wachtwoord" 166 | 167 | #: templates/registration/password_reset_confirm.html:29 168 | msgid "" 169 | "The password reset link was invalid, possibly because it has already been " 170 | "used. Please request a new password reset." 171 | msgstr "" 172 | "De link om het wachtwoord te resetten was niet geldig, mogelijk omdat het" 173 | "al gebruikt is. Vraag een nieuwe reset aan." 174 | 175 | #: templates/registration/password_reset_done.html:6 176 | msgid "Password reset successful" 177 | msgstr "Wachtwoord succesvol gereset" 178 | 179 | #: templates/registration/password_reset_done.html:10 180 | msgid "We have sent you instructions for setting your password." 181 | msgstr "We hebben instructies gestuurd om je wachtwoord te resetten." 182 | 183 | #: templates/registration/password_reset_email.html:2 184 | #, python-format 185 | msgid "" 186 | "You're receiving this e-mail because you requested a password reset for your " 187 | "user account at %(site_name)s." 188 | msgstr "" 189 | "Je ontvangt deze e-mail omdat je je wachtwoord bij %(site_name)s opnieuw wilde" 190 | "instellen." 191 | 192 | #: templates/registration/password_reset_email.html:4 193 | msgid "Please go to the following page and choose a new password:" 194 | msgstr "Ga alsjeblieft naar de volgende pagina en kies een nieuw wachtwoord:" 195 | 196 | #: templates/registration/password_reset_email.html:9 197 | msgid "Thanks for using our site!" 198 | msgstr "Bedankt voor de moeite!" 199 | 200 | #: templates/registration/password_reset_email.html:11 201 | #, python-format 202 | msgid "The %(site_name)s team" 203 | msgstr "Namens het %(site_name) team" 204 | 205 | #: templates/registration/password_reset_form.html:5 206 | msgid "Password reset" 207 | msgstr "Reset wachtwoord" 208 | 209 | #: templates/registration/password_reset_form.html:9 210 | msgid "" 211 | "Enter your e-mail address below, and we will send instructions for setting a " 212 | "new one." 213 | msgstr "" 214 | "Vul je e-mail adres in en we sturen je instructies om je wachtwoord" 215 | "opnieuw in te stellen." 216 | 217 | #: templates/registration/registration_closed.html:6 218 | msgid "Registration closed" 219 | msgstr "Registratie gesloten" 220 | 221 | #: templates/registration/registration_closed.html:10 222 | msgid "We are sorry but registration is temporarily closed." 223 | msgstr "Het spijt ons maar de registratie is op dit moment gesloten." 224 | 225 | #: templates/registration/registration_closed.html:11 226 | msgid "" 227 | "Please come back shortly and try again. We apologize for the inconvenience." 228 | msgstr "" 229 | "Probeer het binnenkort nog eens. Onze excuses voor het ongemak." 230 | 231 | #: templates/registration/registration_complete.html:6 232 | msgid "Registration complete" 233 | msgstr "Registratie voltooid" 234 | 235 | #: templates/registration/registration_complete.html:10 236 | msgid "Thank you for your registration!" 237 | msgstr "Bedankt voor je aanmelding!" 238 | 239 | #: templates/registration/registration_complete.html:11 240 | msgid "You will receive an email with an activation link shortly." 241 | msgstr "Je krijgt spoedig een e-mail met daarin de activatielink." 242 | 243 | #: templates/registration/registration_form.html:6 244 | msgid "Registration form" 245 | msgstr "Registratieformulier" 246 | 247 | #: templates/registration/registration_form.html:20 248 | msgid "Register" 249 | msgstr "Registreer" 250 | -------------------------------------------------------------------------------- /registration_email/locale/pl/LC_MESSAGES/django.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2013 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # MARCIN SPOCZYŃSKI , 2013. 5 | # 6 | #, sandlbn 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: 0.6\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2013-08-31 23:57+0200\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: Marcin Spoczynski \n" 14 | "Language-Team: PL \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " 20 | "|| n%100>=20) ? 1 : 2);\n" 21 | 22 | #: forms.py:60 forms.py:82 templates/registration/login.html:15 23 | msgid "Email" 24 | msgstr "Email" 25 | 26 | #: forms.py:86 27 | msgid "Password" 28 | msgstr "Hasło" 29 | 30 | #: forms.py:90 31 | msgid "Password (repeat)" 32 | msgstr "Hasło (powtórz)" 33 | 34 | #: forms.py:105 35 | msgid "A user with that email already exists." 36 | msgstr "Użytkownik o tym adresie email już istnieje." 37 | 38 | #: forms.py:118 39 | msgid "Please enter a valid name." 40 | msgstr "Proszę wprowadź poprawną nazwę" 41 | 42 | #: forms.py:125 43 | msgid "The two password fields didn't match." 44 | msgstr "Podane dwa hasła nie pasują do siebie." 45 | 46 | #: templates/registration/activate.html:6 47 | msgid "Activation failure" 48 | msgstr "Błąd aktywacji" 49 | 50 | #: templates/registration/activate.html:10 51 | msgid "We are sorry but something went wrong!" 52 | msgstr "Przepraszamy, ale coś poszło nie tak !" 53 | 54 | #: templates/registration/activate.html:11 55 | msgid "The activation link you provided is broken or was already used." 56 | msgstr "Link aktywacji który wprowadziłeś jest zepsuty lub był już użyty" 57 | 58 | #: templates/registration/activation_complete.html:6 59 | msgid "Activation complete" 60 | msgstr "Aktywacja zakończona" 61 | 62 | #: templates/registration/activation_complete.html:10 63 | msgid "You may now login with your username and password." 64 | msgstr "Teraz zaloguj się za pomocą swojej nazwy użytkownika i hasła" 65 | 66 | #: templates/registration/activation_complete.html:12 67 | msgid "Login now" 68 | msgstr "Zaloguj się" 69 | 70 | #: templates/registration/activation_complete.html:14 71 | msgid "Home" 72 | msgstr "Start" 73 | 74 | #: templates/registration/activation_email.txt:5 75 | #, python-format 76 | msgid "" 77 | "\n" 78 | "You have asked to register an account at %(site_name)s.\n" 79 | "If this wasn't you, please ignore this email.\n" 80 | "\n" 81 | "To activate this account, please click the following link within the next\n" 82 | "%(expiration_days)s days:\n" 83 | msgstr "" 84 | "\n" 85 | "Poprosiłeś o rejestrację konta na stronie %(site_name)s.\n" 86 | "Jeśli to nie byłeś Ty, proszę zignoruj tą wiadomość.\n" 87 | "\n" 88 | "Aby aktywować konto. proszę kliknij to łącze w ciągu\n" 89 | "%(expiration_days)s dni:\n" 90 | 91 | #: templates/registration/activation_email.txt:15 92 | msgid "Sincerely," 93 | msgstr "Drogi" 94 | 95 | #: templates/registration/activation_email_subject.txt:2 96 | msgid "Account Request" 97 | msgstr "Aktywacja konta" 98 | 99 | #: templates/registration/login.html:6 templates/registration/login.html:28 100 | #: templates/registration/password_reset_complete.html:11 101 | msgid "Login" 102 | msgstr "Login" 103 | 104 | #: templates/registration/login.html:24 105 | msgid "Forgot your password?" 106 | msgstr "Zapomniałeś swoje hasło" 107 | 108 | #: templates/registration/login.html:25 109 | msgid "Register a new account" 110 | msgstr "Zarejestruj nowe konto" 111 | 112 | #: templates/registration/logout.html:6 113 | msgid "Logout" 114 | msgstr "Wyloguj" 115 | 116 | #: templates/registration/logout.html:10 117 | msgid "You have been logged out." 118 | msgstr "Zostałeś wylogowany" 119 | 120 | #: templates/registration/password_change_done.html:6 121 | msgid "Password change successful" 122 | msgstr "Hasło zostało pomyślnie zmienione" 123 | 124 | #: templates/registration/password_change_done.html:10 125 | msgid "Your password has been changed." 126 | msgstr "Twoje hasło zostało zmienione." 127 | 128 | #: templates/registration/password_change_done.html:11 129 | msgid "Back to dashboard" 130 | msgstr "Powróć do panelu" 131 | 132 | #: templates/registration/password_change_form.html:6 133 | msgid "Password change" 134 | msgstr "Hasło zmienione" 135 | 136 | #: templates/registration/password_change_form.html:10 137 | msgid "Please enter your old password, then enter your new password twice." 138 | msgstr "Proszę wprowadź swoje stare hasło, a następnie powtórz dwa razy nowe hasło." 139 | 140 | #: templates/registration/password_change_form.html:21 141 | msgid "Save" 142 | msgstr "Zapisz" 143 | 144 | #: templates/registration/password_change_form.html:22 145 | #: templates/registration/password_reset_form.html:20 146 | msgid "Reset password" 147 | msgstr "Zresetuj hasło" 148 | 149 | #: templates/registration/password_reset_complete.html:6 150 | msgid "Password reset complete" 151 | msgstr "Resetowanie hasła zakończone" 152 | 153 | #: templates/registration/password_reset_complete.html:10 154 | msgid "Please login with your new password." 155 | msgstr "Proszę zaloguj się swoim nowym hasłem." 156 | 157 | #: templates/registration/password_reset_confirm.html:7 158 | msgid "Enter new password" 159 | msgstr "Wprowadź nowe hasło" 160 | 161 | #: templates/registration/password_reset_confirm.html:9 162 | msgid "Error resetting password" 163 | msgstr "Błąd resetowania hasła" 164 | 165 | #: templates/registration/password_reset_confirm.html:15 166 | msgid "Please enter your new password twice." 167 | msgstr "Wprowadź swoje nowe hasło dwa razy." 168 | 169 | #: templates/registration/password_reset_confirm.html:26 170 | msgid "Change my password" 171 | msgstr "Zmień moje hasło" 172 | 173 | #: templates/registration/password_reset_confirm.html:29 174 | msgid "" 175 | "The password reset link was invalid, possibly because it has already been " 176 | "used. Please request a new password reset." 177 | msgstr "" 178 | "Link do zresetowania hasła jest błędny, prawdopodobnie już został " 179 | "wykorzystany. Proszę ponów procedurę resetu hasła" 180 | 181 | #: templates/registration/password_reset_done.html:6 182 | msgid "Password reset successful" 183 | msgstr "Hasło zresetowane" 184 | 185 | #: templates/registration/password_reset_done.html:10 186 | msgid "We have sent you instructions for setting your password." 187 | msgstr "Przesłaliśmy Tobie instrukcję do ustawienia hasła." 188 | 189 | #: templates/registration/password_reset_email.html:2 190 | #, python-format 191 | msgid "" 192 | "You're receiving this e-mail because you requested a password reset for your " 193 | "user account at %(site_name)s." 194 | msgstr "" 195 | "Dostałeś tę wiadomość ponieważ, zarządałeś zresetowania hasła" 196 | "do Twojego konta na stronie %(site_name)s." 197 | 198 | #: templates/registration/password_reset_email.html:4 199 | msgid "Please go to the following page and choose a new password:" 200 | msgstr "Proszę przejdź na tą stronę i ustaw nowe hasło:" 201 | 202 | #: templates/registration/password_reset_email.html:9 203 | msgid "Thanks for using our site!" 204 | msgstr "Dziękujemy za używanie naszej strony!" 205 | 206 | #: templates/registration/password_reset_email.html:11 207 | #, python-format 208 | msgid "The %(site_name)s team" 209 | msgstr "Zespół %(site_name)s team" 210 | 211 | #: templates/registration/password_reset_form.html:5 212 | msgid "Password reset" 213 | msgstr "Reset hasła" 214 | 215 | #: templates/registration/password_reset_form.html:9 216 | msgid "" 217 | "Enter your e-mail address below, and we will send instructions for setting a " 218 | "new one." 219 | msgstr "" 220 | "Wprowadź Twój adres email poniżej, prześlemy na niego instrukcję" 221 | "do ustawienia nowego hasła" 222 | 223 | #: templates/registration/registration_closed.html:6 224 | msgid "Registration closed" 225 | msgstr "Rejestracja zamknięta" 226 | 227 | #: templates/registration/registration_closed.html:10 228 | msgid "We are sorry but registration is temporarily closed." 229 | msgstr "Przepraszamy, ale rejestracja jest chwilowo zamknięta" 230 | 231 | #: templates/registration/registration_closed.html:11 232 | msgid "" 233 | "Please come back shortly and try again. We apologize for the inconvenience." 234 | msgstr "Prosimy wrócić niebawem i spróbować ponownie. Przepraszamy za utrudnienia." 235 | 236 | #: templates/registration/registration_complete.html:6 237 | msgid "Registration complete" 238 | msgstr "Rejestracja zakończona" 239 | 240 | #: templates/registration/registration_complete.html:10 241 | msgid "Thank you for your registration!" 242 | msgstr "Dziękujemy za rejestrację!" 243 | 244 | #: templates/registration/registration_complete.html:11 245 | msgid "You will receive an email with an activation link shortly." 246 | msgstr "Powinieneś niedługo dostać wiadomość z linkiem aktywacyjnym." 247 | 248 | #: templates/registration/registration_form.html:6 249 | msgid "Registration form" 250 | msgstr "Formularz rejestracyjny" 251 | 252 | #: templates/registration/registration_form.html:20 253 | msgid "Register" 254 | msgstr "Rejestracja" 255 | --------------------------------------------------------------------------------