I am using the django-registration package. I do not want people to have a username but to enter instead their first and last names. Like on Facebook. How can I do that ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Django auth (and by extension admin) requires a username – full stop. So you’ll have to go to some effort to work around that.
You have a few issues to consider:
1) Firstname Lastname will rapidly lead to collisions. What does your service do when the second “John Smith” wants to sign up?
2) You have to create a username, so you’ll likely use a hash of firstname_lastname. Again, what do you do when you get a second exact match?
3) You’ll have to write a custom auth backend to take care of the login, this isn’t actually that hard.
A prototype of the solution to #2 can be found here – basically in the form processing, generate a random unique hash.