Login using phone and number

77 views
Skip to first unread message

Yash Trivedi

unread,
Apr 13, 2024, 10:38:30 AM4/13/24
to Django users
I need a code for login using phone number and password without using form.py 
and tell me how can I do quickly 

Ryan Nowakowski

unread,
Apr 14, 2024, 2:15:57 PM4/14/24
to django...@googlegroups.com
First, I'm assuming you're not yet storing the users phone number so... Is this a brand new Django project? If so you can look into creating a custom user model [1] that has a unique phone number field [2].  If it's an already existing project, you can look into adding a profile [3] that contains a phone number field.

Next, most user input including login is handled using Django forms [4]. Any reason why you don't want to use it?

[1] https://docs.djangoproject.com/en/5.0/topics/auth/customizing/#auth-custom-user
[2] https://docs.djangoproject.com/en/5.0/topics/auth/customizing/#extending-user
[3] https://django-phonenumber-field.readthedocs.io/en/latest/
[4] https://docs.djangoproject.com/en/5.0/topics/forms/
Reply all
Reply to author
Forward
0 new messages