Skip to content

Internet Address : email , url , ip

Majid Ahmaditabar edited this page Dec 10, 2021 · 2 revisions

email

  • The field under validation must be formatted as an email address.

url

  • The field under validation must be a valid URL.

ip

  • The field under validation must be an IP address.

ipv4

  • The field under validation must be an IPv4 address.

ipv6

  • The field under validation must be an IPv6 address.

data = {
  "email": "[email protected]",
  "url": "http://google.com",
  "ip": "192.168.1.1",
  "ipv4": "192.168.1.1",
  "ipv6": "2001:0db8:85a3:0000:0000:8a2e:0370:7334"
}

rules = {
  "email": ["required", "email"],
  "url": ["required", "url"],
  "ip": ["required", "ip"],
  "ipv4": ["required", "ipv4"],
  "ipv6": ["required", "ipv6"],
}

validate = PyValidations.make(data, rules)
Clone this wiki locally