Answers for "django email validator"

1

using regex validators in django models

from django.core.validators import RegexValidator
from django.db import models
PHONE_NUMBER_REGEX = RegexValidator(r'^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-s./0-9]*$', 'only valid email is required')
class SomeClass(models.Model):
  phone =  models.CharField(max_length=14, validators=[PHONE_REGEX])
Posted by: Guest on September-18-2020
-1

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)
Posted by: Guest on March-23-2021

Python Answers by Framework

Browse Popular Code Answers by Language