How do I use emails instead of username for authentication using django-registration.
Further how do I enforce this change once I have already installed the registration
The simplest way would be to hide the username field in the registration_form template with CSS display:none property. And add a script which takes the value from the email form field and sets the value in the hidden username field. So while submitting the form, the user submits the email as username without knowing it. The only problem is since a username field, by default, cannot accept an email which is longer than 30 characters. So, for safe bet, you should increase the username length manually in your database.
Here is the new registration_form.html template:
The Simple jQuery srcipt that sets the value in the hidden form field username is:
$(document).ready(function()
{
$('#id_email').blur(function(e)
{
var email_address = $('#id_email').val();
$('#id_username').val(email_address);
});
});
The ids id_email and id_username are set by the django-registration form automatically.