Package: django-registration-email
Important=========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.Why don't you check out ``django-allauth``: https://github.com/pennersr/django-allauthIt's already integrated in our project template (incl. templates & settings): https://github.com/bitmazk/django-project-template/It's configured the way we used this app.django-registration-email==========================We use[django-registration](https://bitbucket.org/ubernostrum/django-registration/overview)in almost all our projects. However, we don't like Django's limited usernameand would like to allow our users to sign up via email.This project provides a custom authentication backend which allows users toauthenticate via email. We also provide an EmailRegistrationForm whichchecks if an email has already been taken.Since we still have to store a username and since emails can easily be longerthan 30 characters, the username will be computed as a md5 hexdigest of theemail address.We included a ``urls.py`` that overrides all URLs of django-registrationand Django's auth with a clean and sane structure and you will find a defaultset of all necessary templates.Usage======Install this package::pip install -e git://github.com/bitmazk/django-registration-email#egg=registration_emailAdd ``registration`` and ``registration_email`` to your ``INSTALLED_APPS``::INSTALLED_APPS = [# all your other apps'registration','registration_email',]Update your ``urls.py``::url(r'^accounts/', include('registration_email.backends.default.urls')),Add some settings to your ``settings.py``::ACCOUNT_ACTIVATION_DAYS = 7AUTHENTICATION_BACKENDS = ('registration_email.auth.EmailBackend',)LOGIN_REDIRECT_URL = '/'Run ``syncdb``::./manage.py syncdbSettings========django-registration-email introduces a new setting:REGISTRATION_EMAIL_ACTIVATE_SUCCESS_URL---------------------------------------Default: ``lambda request, user: '/'``Function to return the URL to redirect to after a successful accountactivation. If you leave this at ``lambda request, user: '/'`` it will directto your base URL.REGISTRATION_EMAIL_REGISTER_SUCCESS_URL---------------------------------------Default: ``lambda request, user: '/'``Function to return the URL to redirect to after a successful accountregistration. If you leave this at ``lambda request, user: '/'`` it will directto your base URL.How to use a custom form========================Let's say you want to collect the user's first name and last name when heregisters. In order to achieve that, you need to do the following:__1. Create a custom form__Create a new app `my_registration` in your project and give it a `forms.py`where you override our `EmailRegistrationForm` and your desired extrafields:from django import formsfrom registration_email.forms import EmailRegistrationFormclass CustomEmailRegistrationForm(EmailRegistrationForm):first_name = forms.CharField()last_name = forms.CharField()Do NOT override the form's `save()` method.__2. Override the URL__Now you need to tell the registration view that it is supposed to use thecustom form:# your main urls.py...from django.conf import settingsfrom registration.backends.simple.views import RegistrationViewfrom my_registration.forms import CustomEmailRegistrationFormurlpatterns = [...url(r'^accounts/register/$',RegistrationView.as_view(template_name='registration/registration_form.html',form_class=CustomEmailRegistrationForm,get_success_url=getattr(settings, 'REGISTRATION_EMAIL_REGISTER_SUCCESS_URL',lambda request, user: '/'),),name='registration_register',),url(r'^accounts/', include('registration_email.backends.default.urls')),...]__3. Create a signal handler__In the `urls.py` above I'm using the `SimpleBackend`. When you have a lookat that [backend](https://github.com/nathanborror/django-registration/blob/master/registration/backends/simple/__init__.py#L30)you will see that the backend sends a signal after creating and logging in theuser. The signal will get all parameters that we need in order to access thedata that has been validated and sent by the form, so let's build a signalhandler:# in my_registration.models.pyfrom django.dispatch import receiverfrom registration.signals import user_registered@receiver(user_registered)def user_registered_handler(sender, user, request, **kwargs):user.first_name = request.POST.get('first_name')user.last_name = request.POST.get('last_name')user.save()This method has the drawback that you save the user two times in a row. Ifyou have concerns about performance you would have to create your own`my_registration.backends.CustomRegistrationBackend` class. That class wouldinherit `registration.backends.simple.SimpleBackend` and override the`register` method.But really, we are talking about registration here, I can't imagine how savingthe user twice could do any harm.Troubleshooting================If you had another value for ``AUTHENTICATION_BACKENDS`` in your``settings.py`` before it might be that it is saved in your ``django_session``table. I found no other way around this than to delete the rows in that table.TODO=====* Password reset link points to original django template