Skip to main content

no more invalid or disposable emails in your database.

Project description

django-email-validators

no more invalid or disposable emails in your database.

Installation

  • Run pip install django-email-validators
  • Add django_email_validators to settings.INSTALLED_APPS
  • Restart your application server

Usage

Validators

  • 🗑️ validate_email_non_disposable
  • 🌐 validate_email_mx
  • ✍️ validate_email_provider_typo

validate_email_non_disposable

Validates that the email is not from a disposable email provider (fast, offline check).

validate_email_mx

Validates that the email domain has valid MX records (slow, requires network access).

validate_email_provider_typo

Validates that the email domain is not a likely typo of a common email provider. Checks a one-character diff against 80+ common providers and verifies the domain has no valid MX records (prevents false positives).

Examples that will be caught:

  • user@gmai.com -> suggests user@gmail.com
  • user@gmail.co -> suggests user@gmail.com
  • user@yahooo.com -> suggests user@yahoo.com

Usage

from django.db import models
from django_email_validators import (
    validate_email_non_disposable,
    validate_email_mx,
    validate_email_provider_typo,
)

class User(models.Model):
    email = models.EmailField(
        validators=[
            validate_email_non_disposable,
            validate_email_mx,
            validate_email_provider_typo,
        ]
    )

Testing

# clone repository
git clone https://github.com/fabiocaccamo/django-email-validators.git && cd django-email-validators

# create virtualenv and activate it
python -m venv venv && . venv/bin/activate

# upgrade pip
python -m pip install --upgrade pip

# install requirements
pip install -r requirements.txt -r requirements-test.txt

# install pre-commit to run formatters and linters
pre-commit install --install-hooks

# run tests
tox
# or
pytest

License

Released under MIT License.


Supporting

  • :star: Star this project on GitHub
  • :octocat: Follow me on GitHub
  • :blue_heart: Follow me on Bluesky
  • :moneybag: Sponsor me on Github

See also

  • django-admin-interface - the default admin interface made customizable by the admin itself. popup windows replaced by modals. 🧙 ⚡

  • django-cache-cleaner - clear the entire cache or individual caches easily using the admin panel or management command. 🧹

  • django-colorfield - simple color field for models with a nice color-picker in the admin. 🎨

  • django-extra-settings - config and manage typed extra settings using just the django admin. ⚙️

  • django-maintenance-mode - shows a 503 error page when maintenance-mode is on. 🚧 🛠️

  • django-redirects - redirects with full control. ↪️

  • django-treenode - probably the best abstract model / admin for your tree based stuff. 🌳

  • python-benedict - dict subclass with keylist/keypath support, I/O shortcuts (base64, csv, json, pickle, plist, query-string, toml, xml, yaml) and many utilities. 📘

  • python-codicefiscale - encode/decode Italian fiscal codes - codifica/decodifica del Codice Fiscale. 🇮🇹 💳

  • python-fontbro - friendly font operations. 🧢

  • python-fsutil - file-system utilities for lazy devs. 🧟‍♂️

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_email_validators-0.2.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_email_validators-0.2.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file django_email_validators-0.2.0.tar.gz.

File metadata

  • Download URL: django_email_validators-0.2.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_email_validators-0.2.0.tar.gz
Algorithm Hash digest
SHA256 db7b1e3dcb8dc2b5ab20889b52bdd0f2146d02e2d035328160951c00769ecf98
MD5 73bb64b87572d063f790d588762013b0
BLAKE2b-256 2e8ba745c1af393ff52b9d512fc75c9a9a6d8e3b64f714ecfd0258aad076c064

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_email_validators-0.2.0.tar.gz:

Publisher: create-release.yml on fabiocaccamo/django-email-validators

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_email_validators-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_email_validators-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a58dd432171c72b62383ad005cd48f3a5e32f6a0df4552a2c9b878ddf08ba26f
MD5 7505d5610463953d330872472c768f93
BLAKE2b-256 b392b5df3ca5a83602bb773bc1c78ee98cd66543d79065a999054395df7698a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_email_validators-0.2.0-py3-none-any.whl:

Publisher: create-release.yml on fabiocaccamo/django-email-validators

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page