Why does Django not allow spaces in user's usernames? On my site, a
user's username is the first and last name combined (the equivalent of
user.get_full_name()).
On Jun 12, 1:26 pm, Wiiboy <jordon...@gmail.com> wrote:
> Why does Django not allow spaces in user's usernames? On my site, a > user's username is the first and last name combined (the equivalent of > user.get_full_name()).
I guess it's just for simplicity and validation purposes. It would be really difficult to detect users with whitespaces I guess.
On Friday 12 June 2009 12:10:51 Joshua Partogi wrote:
> On Jun 12, 1:26 pm, Wiiboy <jordon...@gmail.com> wrote: > > Why does Django not allow spaces in user's usernames? On my site, a > > user's username is the first and last name combined (the equivalent of > > user.get_full_name()).
> I guess it's just for simplicity and validation purposes. It would be > really difficult to detect users with whitespaces I guess.
Do you think I would have problems if I disabled the checking for
spaces?
When I register users, I have it done automatically (user fills out a
form), and Django doesn't have a problem with a space there. It's
just in the Admin interface.
> Do you think I would have problems if I disabled the checking for
> spaces?
> When I register users, I have it done automatically (user fills out a
> form), and Django doesn't have a problem with a space there. It's
> just in the Admin interface.
I'm puzzled with this too. Did anyone manage to find a solution to resolving spaces in usernames.
Generally a user, these days logs in with their email - that's predominately how I've setup all my django projects. People don't remember usernames. It is legacy, facebook connects with emails, so does gmail and the rest of the world. Username really has fallen back to a NickName / Alternative / Alias kind of field. You'd use it if you knew that in your application people wouldn't want their real, full names to be displayed.
On Friday, June 12, 2009 4:08:12 PM UTC+2, Wiiboy wrote:
> On Jun 12, 6:55 am, Marco Louro <mlo...@gmail.com> wrote: > > As long as you trim start and trailing spaces, there shouldn't be any > > problem, but personally I wouldn't use spaces in usernames at all.
> I'm puzzled with this too. Did anyone manage to find a solution to resolving
> spaces in usernames.
> Generally a user, these days logs in with their email - that's predominately
> how I've setup all my django projects. People don't remember usernames. It
Well, I can't really agree, but whatever, it shouldn't be hard to do..
just override the forms... at the worse of cases, the User model...
--
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde
|_|0|_|
|_|_|0|
|0|0|0|
(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.
(imo) Allowing spaces in username just isn't a very sane approach.
Rather than telling the user to choose a username, why not make them login
with their email address instead? Users are less likely to forget their
email address, and if anything, it would be less error prone than a
username would, especially one with spaces.
By all means, you can allow users to have spaces in their alias / nickname
field, but allowing them to login with it might not be the best approach.
Hope this helps!
Cal
On Sat, Nov 17, 2012 at 8:14 AM, Paul von Hoesslin <
paulvonhoess...@gmail.com> wrote:
> I'm puzzled with this too. Did anyone manage to find a solution to
> resolving spaces in usernames.
> Generally a user, these days logs in with their email - that's
> predominately how I've setup all my django projects. People don't remember
> usernames. It is legacy, facebook connects with emails, so does gmail and
> the rest of the world. Username really has fallen back to a NickName /
> Alternative / Alias kind of field. You'd use it if you knew that in your
> application people wouldn't want their real, full names to be displayed.
> On Friday, June 12, 2009 4:08:12 PM UTC+2, Wiiboy wrote:
>> On Jun 12, 6:55 am, Marco Louro <mlo...@gmail.com> wrote:
>> > As long as you trim start and trailing spaces, there shouldn't be any
>> > problem, but personally I wouldn't use spaces in usernames at all.
>> Why not?
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/UGdOmEepavIJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
cal.leem...@simplicitymedialtd.co.uk> wrote:
> (imo) Allowing spaces in username just isn't a very sane approach.
> Rather than telling the user to choose a username, why not make them login
> with their email address instead? Users are less likely to forget their
> email address, and if anything, it would be less error prone than a
> username would, especially one with spaces.
> By all means, you can allow users to have spaces in their alias / nickname
> field, but allowing them to login with it might not be the best approach.
> Hope this helps!
> Cal
> On Sat, Nov 17, 2012 at 8:14 AM, Paul von Hoesslin <
> paulvonhoess...@gmail.com> wrote:
>> I'm puzzled with this too. Did anyone manage to find a solution to
>> resolving spaces in usernames.
>> Generally a user, these days logs in with their email - that's
>> predominately how I've setup all my django projects. People don't remember
>> usernames. It is legacy, facebook connects with emails, so does gmail and
>> the rest of the world. Username really has fallen back to a NickName /
>> Alternative / Alias kind of field. You'd use it if you knew that in your
>> application people wouldn't want their real, full names to be displayed.
>> On Friday, June 12, 2009 4:08:12 PM UTC+2, Wiiboy wrote:
>>> On Jun 12, 6:55 am, Marco Louro <mlo...@gmail.com> wrote:
>>> > As long as you trim start and trailing spaces, there shouldn't be any
>>> > problem, but personally I wouldn't use spaces in usernames at all.
>>> Why not?
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/UGdOmEepavIJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
If you need to do login via email address, it is possible right now -- it's
just a little convoluted. You need to play around with custom
authentication backends, and rewrite a bunch of forms.
In Django 1.5, we're addressing this by making the User model customisable.
That means you can specify that the "username" is an EmailField, of
whatever length you like, or you can specify the username is an "alias",
which allows spaces -- whatever your use case requires.
For more details, see the docs for the new feature [1]; 1.5 final should be
released towards the end of this year.
paulvonhoess...@gmail.com> wrote:
> I'm puzzled with this too. Did anyone manage to find a solution to
> resolving spaces in usernames.
> Generally a user, these days logs in with their email - that's
> predominately how I've setup all my django projects. People don't remember
> usernames. It is legacy, facebook connects with emails, so does gmail and
> the rest of the world. Username really has fallen back to a NickName /
> Alternative / Alias kind of field. You'd use it if you knew that in your
> application people wouldn't want their real, full names to be displayed.
> On Friday, June 12, 2009 4:08:12 PM UTC+2, Wiiboy wrote:
>> On Jun 12, 6:55 am, Marco Louro <mlo...@gmail.com> wrote:
>> > As long as you trim start and trailing spaces, there shouldn't be any
>> > problem, but personally I wouldn't use spaces in usernames at all.
>> Why not?
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/UGdOmEepavIJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
One obvious problem case -- email addresses longer than 30 characters. The
current username field has a 30 character max, which is easy to exceed if
you try and put email addresses into the username field.
Django 1.5 addresses this by allowing your user model to be customisable,
so you can make the username constraints whatever you want.
On Mon, Nov 19, 2012 at 1:12 PM, Elena Williams <ele....@gmail.com> wrote:
> Apparently some weirdness can be caused by having email addresses as
> usernames in django, though I'm not sure specifically what this is.
> Does anyone know these cases?
> ---
> Elena :)
> @elequ
> On Mon, Nov 19, 2012 at 4:05 PM, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>> (imo) Allowing spaces in username just isn't a very sane approach.
>> Rather than telling the user to choose a username, why not make them
>> login with their email address instead? Users are less likely to forget
>> their email address, and if anything, it would be less error prone than a
>> username would, especially one with spaces.
>> By all means, you can allow users to have spaces in their alias /
>> nickname field, but allowing them to login with it might not be the best
>> approach.
>> Hope this helps!
>> Cal
>> On Sat, Nov 17, 2012 at 8:14 AM, Paul von Hoesslin <
>> paulvonhoess...@gmail.com> wrote:
>>> I'm puzzled with this too. Did anyone manage to find a solution to
>>> resolving spaces in usernames.
>>> Generally a user, these days logs in with their email - that's
>>> predominately how I've setup all my django projects. People don't remember
>>> usernames. It is legacy, facebook connects with emails, so does gmail and
>>> the rest of the world. Username really has fallen back to a NickName /
>>> Alternative / Alias kind of field. You'd use it if you knew that in your
>>> application people wouldn't want their real, full names to be displayed.
>>> On Friday, June 12, 2009 4:08:12 PM UTC+2, Wiiboy wrote:
>>>> On Jun 12, 6:55 am, Marco Louro <mlo...@gmail.com> wrote:
>>>> > As long as you trim start and trailing spaces, there shouldn't be any
>>>> > problem, but personally I wouldn't use spaces in usernames at all.
>>>> Why not?
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msg/django-users/-/UGdOmEepavIJ.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscribe@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.