1. i don't know whether it is expected behavior or not.

But here are some ways to solve the above problem.
-----------------------------------------------------------------------------------
Why it is not accepting @ character in admin ?

As the username of  UserCreation form  ( from
django.contrib.auth.forms
import UserCreationForm )  form  associated with alphanumeric
regular expression it is not accepting @:

regex=r'^\w+$'  (below you see the code)

How to change the form to accept it?
-------------------------------------------------------
Solution1:
~~~~~~~~~~~
Please follow the below link
http://stackoverflow.com/questions/471550/customizing-an-admin-form-in-django-while-also-using-autodiscover

1.instead of list_filter change the add_form
2.change UserCreationForm(django.contrib.auth.form.......) to accept @
for username
  ( this i hope you can do be creating an instance and changing the
field attributes)
3.associate the changed UserCreationForm to add_form

Then you can able to accept  @. ( i haven;t tested it)

Solution 2:
-------------------
Write a new authentication  backend which authenticates based on email
and password
 more details : http://bit.ly/hekni

Solution 3:
----------------------
1.Give the email address in email field
2.move this email to username once user object is being saved by
catching the postsignal.


On Jun 23, 11:22 am, bvemu <balu.v...@gmail.com> wrote:
> Hi
>
> I was using the email ID as the username as shown below in my view.py
>
> view.py
> ----------
> def signup(request)
> ..
>       username=emailid ;
>       valid_user = authenticate
> (username=username,password=password  )
> ..
>
> and it works fine for me
>
> Django version being the development version
>
> # django-admin.py --version
> 1.1 beta 1 SVN-10957
>
> 1.) The problem is in the admin interface "@" is not accepted as
> username while I can populate the same from the view.py
> Is this an expected behaviour or should I raise a ticket ( if at all
> it doesnt exists )
>
> 2.) Do we have a configuration file or so where we can define these
> constraints like max_length of user name, accepted character set  in
> the user name and others.
> I can very well change the code in django-trunk of my web server,  but
> I dont want to do that since I want to avoid the overhead of re-doing
> the svn tasks
>
> Thanks
> Subramanyam
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to