Django 5 Validator Email Verification Guide
Add real-time email verification and disposable-email blocking to Django 5 Validator with the VeriShield Edge API. The snippet below gates a signup and returns the canonical email identity.
Language
Python 3.12
Ecosystem
Django / ORM
Latency
< 85ms
Install
Shell
pip install django requestsVerification code
Python 3.12
import os, requests
from django.core.exceptions import ValidationError
def verify_email(value):
resp = requests.post(
'https://verishield-edge-api.p.rapidapi.com/v1/verify',
headers={'X-RapidAPI-Key': os.environ.get('RAPIDAPI_KEY', '')},
json={'email': value}, timeout=3
)
data = resp.json()
if data['fraud_risk']['recommendation'] == 'BLOCK':
raise ValidationError('Disposable or high-risk email addresses are not allowed.')
return data['canonical_email']What this protects against
Disposable and temporary inboxes, Gmail dot-trick and plus-alias multi-accounting, high-entropy bot usernames, and freshly registered fraud domains. The API returns a 0-100 fraud score with an ALLOW, CHALLENGE_2FA or BLOCK recommendation.