0

What is the best way to implement django 2 login and registration like instagram.com. user can register with username and email or phone and password. after register user can login with email address, phone number or username.

Thanks

  • https://stackoverflow.com/questions/31370118/multiple-username-field-in-django-user-model – Ramkishore M Apr 19 '18 at 11:27
  • Thank you for your reply. Hmm look like Implementing this is the only way to do this. def authenticate(self, username=None, password=None): Is there are any security issue implement this ? – Lakshitha Kumara Apr 19 '18 at 12:22
  • None is there as default value. Authentication will fail if either value is None. So no security issues. – Ramkishore M Apr 19 '18 at 12:38

1 Answers1

0

A great thing about Django is that it comes with a User model already. You just have to apply it to your site.

Check out the user documentation Here

This will give you all the fields you can use, and how to make a member style website

  • Thank you for your reply. yes i using this user model but Django USERNAME_FIELD only can use one field. i need use login username field as a email, phone or username. – Lakshitha Kumara Apr 19 '18 at 12:20