<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Logging In With Email Addresses in Django</title>
	<atom:link href="http://www.davidcramer.net/code/224/logging-in-with-email-addresses-in-django.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.davidcramer.net/code/224/logging-in-with-email-addresses-in-django.html</link>
	<description>A blog about Django, JavaScript, CSS, and general web development.</description>
	<lastBuildDate>Tue, 09 Mar 2010 21:59:12 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: tyagi</title>
		<link>http://www.davidcramer.net/code/224/logging-in-with-email-addresses-in-django.html/comment-page-1#comment-21044</link>
		<dc:creator>tyagi</dc:creator>
		<pubDate>Sun, 20 Dec 2009 05:32:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=224#comment-21044</guid>
		<description>Have the Django developers given a reason for not wishing to enable Email logins for the built-in User authentication model? Alternatively, have they given a reason for not permitting non-alphanumeric characters in the username field?

Searching for solutions to this issue seems to give a large number of hits for fragmented and 90% working patches or backend extensions. Given that users of Django are obviously experiencing some problems with this developer policy, and the need for Email Usernames is quite apparent, is there a particular reason why they&#039;re not willing to implement it?</description>
		<content:encoded><![CDATA[<p>Have the Django developers given a reason for not wishing to enable Email logins for the built-in User authentication model? Alternatively, have they given a reason for not permitting non-alphanumeric characters in the username field?</p>
<p>Searching for solutions to this issue seems to give a large number of hits for fragmented and 90% working patches or backend extensions. Given that users of Django are obviously experiencing some problems with this developer policy, and the need for Email Usernames is quite apparent, is there a particular reason why they&#8217;re not willing to implement it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cornbread</title>
		<link>http://www.davidcramer.net/code/224/logging-in-with-email-addresses-in-django.html/comment-page-1#comment-21029</link>
		<dc:creator>cornbread</dc:creator>
		<pubDate>Thu, 12 Nov 2009 17:22:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=224#comment-21029</guid>
		<description>I have the same question as steg.

also this seems backward to me. Why didn&#039;t django think &quot;hmm maybe someone might want email as username&quot;

it seems like an ugly hack to attempt to make email unique and can&#039;t use built in login form. Is this so hard to fix? 

p.s. Please explain the permissions comment...</description>
		<content:encoded><![CDATA[<p>I have the same question as steg.</p>
<p>also this seems backward to me. Why didn&#8217;t django think &#8220;hmm maybe someone might want email as username&#8221;</p>
<p>it seems like an ugly hack to attempt to make email unique and can&#8217;t use built in login form. Is this so hard to fix? </p>
<p>p.s. Please explain the permissions comment&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steg</title>
		<link>http://www.davidcramer.net/code/224/logging-in-with-email-addresses-in-django.html/comment-page-1#comment-20998</link>
		<dc:creator>steg</dc:creator>
		<pubDate>Sat, 10 Oct 2009 22:33:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=224#comment-20998</guid>
		<description>A possibly naive question:

The EmailOrUsernameModelBackend allows a user to use their email or username during authentication.
This backend is then added to the list of AUTHENTICATION_BACKENDS **before** the standard ModelBackend, which performs authentication using the username User field.

My question is why does the EmailOrUsernameModelBackend need to support both email and username, rather than just email? To illustrate my point, if I was to log in with username &quot;steg&quot;, the EmailOrUsernameModelBackend.authenticate() method would try to retrieve a User object from the db using keyword arguments {&quot;username&quot;:&quot;steg&quot;}. If this fails, django then moves on and tries the ModelBackend.authenticate() method, which will do exactly the same thing.

Are there other reasons for this apparent duplication? I&#039;m pretty new to django, so apologies in advance if I&#039;m missing something obvious.</description>
		<content:encoded><![CDATA[<p>A possibly naive question:</p>
<p>The EmailOrUsernameModelBackend allows a user to use their email or username during authentication.<br />
This backend is then added to the list of AUTHENTICATION_BACKENDS **before** the standard ModelBackend, which performs authentication using the username User field.</p>
<p>My question is why does the EmailOrUsernameModelBackend need to support both email and username, rather than just email? To illustrate my point, if I was to log in with username &#8220;steg&#8221;, the EmailOrUsernameModelBackend.authenticate() method would try to retrieve a User object from the db using keyword arguments {&#8220;username&#8221;:&#8221;steg&#8221;}. If this fails, django then moves on and tries the ModelBackend.authenticate() method, which will do exactly the same thing.</p>
<p>Are there other reasons for this apparent duplication? I&#8217;m pretty new to django, so apologies in advance if I&#8217;m missing something obvious.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterp</title>
		<link>http://www.davidcramer.net/code/224/logging-in-with-email-addresses-in-django.html/comment-page-1#comment-20883</link>
		<dc:creator>peterp</dc:creator>
		<pubDate>Tue, 14 Jul 2009 09:46:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=224#comment-20883</guid>
		<description>A user can register the same email address more than once. So I&#039;ve modified the code a bit to filter by email addresses.

It then loops through each user found and checks the password individually.</description>
		<content:encoded><![CDATA[<p>A user can register the same email address more than once. So I&#8217;ve modified the code a bit to filter by email addresses.</p>
<p>It then loops through each user found and checks the password individually.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zalun</title>
		<link>http://www.davidcramer.net/code/224/logging-in-with-email-addresses-in-django.html/comment-page-1#comment-20848</link>
		<dc:creator>zalun</dc:creator>
		<pubDate>Tue, 30 Jun 2009 23:02:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=224#comment-20848</guid>
		<description>@keredson
I use similar approach.
I just set the username as a slug of email replacing every weird character with _ and @ with __ 
Seems to work fine 

@David
The only problem I have for the moment is the Admin interface to create users instead of allowing them to register...</description>
		<content:encoded><![CDATA[<p>@keredson<br />
I use similar approach.<br />
I just set the username as a slug of email replacing every weird character with _ and @ with __<br />
Seems to work fine </p>
<p>@David<br />
The only problem I have for the moment is the Admin interface to create users instead of allowing them to register&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: keredson</title>
		<link>http://www.davidcramer.net/code/224/logging-in-with-email-addresses-in-django.html/comment-page-1#comment-20812</link>
		<dc:creator>keredson</dc:creator>
		<pubDate>Wed, 10 Jun 2009 04:31:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=224#comment-20812</guid>
		<description>how do you force emails to be unique in django&#039;s default admin?  i dropped this code into my test app, and the first thing it gave me was &quot;warning, returned 3 objects not 1!&quot; during &quot;User.objects.get(**kwargs)&quot;.</description>
		<content:encoded><![CDATA[<p>how do you force emails to be unique in django&#8217;s default admin?  i dropped this code into my test app, and the first thing it gave me was &#8220;warning, returned 3 objects not 1!&#8221; during &#8220;User.objects.get(**kwargs)&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: markhellewell</title>
		<link>http://www.davidcramer.net/code/224/logging-in-with-email-addresses-in-django.html/comment-page-1#comment-20786</link>
		<dc:creator>markhellewell</dc:creator>
		<pubDate>Tue, 28 Apr 2009 23:09:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=224#comment-20786</guid>
		<description>Nice, thanks. It pleases me to find out Django allows such elegance</description>
		<content:encoded><![CDATA[<p>Nice, thanks. It pleases me to find out Django allows such elegance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carljm</title>
		<link>http://www.davidcramer.net/code/224/logging-in-with-email-addresses-in-django.html/comment-page-1#comment-20284</link>
		<dc:creator>carljm</dc:creator>
		<pubDate>Thu, 18 Sep 2008 13:26:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=224#comment-20284</guid>
		<description>&gt; The reason it doesn’t inherit from ModelBackend is that this allows you to specify a second backend to use for permissions.

Could you expand on this?  I&#039;ve been using an EmailBackend similar to yours, except that it inherits from ModelBackend, overrides only the authenticate() method, and I use it all by itself in AUTHENTICATION_BACKENDS.  This seems to work just fine.  What am I missing that your approach provides?</description>
		<content:encoded><![CDATA[<p>&gt; The reason it doesn’t inherit from ModelBackend is that this allows you to specify a second backend to use for permissions.</p>
<p>Could you expand on this?  I&#8217;ve been using an EmailBackend similar to yours, except that it inherits from ModelBackend, overrides only the authenticate() method, and I use it all by itself in AUTHENTICATION_BACKENDS.  This seems to work just fine.  What am I missing that your approach provides?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: julien</title>
		<link>http://www.davidcramer.net/code/224/logging-in-with-email-addresses-in-django.html/comment-page-1#comment-20119</link>
		<dc:creator>julien</dc:creator>
		<pubDate>Mon, 25 Aug 2008 23:03:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=224#comment-20119</guid>
		<description>Hey, just a quick note. If using the standard login views, you won&#039;t be able to login with an email that&#039;s longer than 30 characters. There&#039;s a ticket with a simple patch which hopefully will get checked in to fix that:
http://code.djangoproject.com/ticket/8274

Cheers,

Julien Phalip</description>
		<content:encoded><![CDATA[<p>Hey, just a quick note. If using the standard login views, you won&#8217;t be able to login with an email that&#8217;s longer than 30 characters. There&#8217;s a ticket with a simple patch which hopefully will get checked in to fix that:<br />
<a href="http://code.djangoproject.com/ticket/8274" rel="nofollow">http://code.djangoproject.com/ticket/8274</a></p>
<p>Cheers,</p>
<p>Julien Phalip</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.davidcramer.net/code/224/logging-in-with-email-addresses-in-django.html/comment-page-1#comment-20116</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 25 Aug 2008 18:03:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=224#comment-20116</guid>
		<description>Ya I did notice that get_user is still required. I updated the above code.

The reason it doesn&#039;t inherit from ModelBackend is that this allows you to specify a second backend to use for permissions.</description>
		<content:encoded><![CDATA[<p>Ya I did notice that get_user is still required. I updated the above code.</p>
<p>The reason it doesn&#8217;t inherit from ModelBackend is that this allows you to specify a second backend to use for permissions.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
