Login with email or phone number django code example
Example 1: how to add phone number to django user model
class ExtendedUserExample(models.Model):
user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
created = models.DateTimeField(auto_now_add=True)
phone_number = models.IntegerField(blank=True)
Example 2: django email verification
I figured out a solution , but for the second requirement user has to input the password at the time of account creation . The main goal was to verify the user supplied email.
Models
class Yourmodel(models.Model):
first_name = models.CharField(max_length=200)
second_name = models.CharField(max_length=200)
email = models.EmailField(max_length=100)