All Projects → aaronbassett → Disposableemailchecker

aaronbassett / Disposableemailchecker

Licence: bsd-3-clause
Python class for use with Django to detect Disposable Emails

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Disposableemailchecker

Django Dynamic Scraper
Creating Scrapy scrapers via the Django admin interface
Stars: ✭ 1,024 (+1948%)
Mutual labels:  django
Pretix
Ticket shop application for conferences, festivals, concerts, tech events, shows, exhibitions, workshops, barcamps, etc.
Stars: ✭ 1,037 (+1974%)
Mutual labels:  django
Hubblemon
Stars: ✭ 48 (-4%)
Mutual labels:  django
Django Rest Pandas
📊📈 Serves up Pandas dataframes via the Django REST Framework for use in client-side (i.e. d3.js) visualizations and offline analysis (e.g. Excel)
Stars: ✭ 1,030 (+1960%)
Mutual labels:  django
Django Migrations Graph
Django-admin command to display migrations with dependencies.
Stars: ✭ 46 (-8%)
Mutual labels:  django
Unchained
Secure password hashers for Go compatible with Django
Stars: ✭ 46 (-8%)
Mutual labels:  django
Django Chinese Doc
Django中文文档
Stars: ✭ 44 (-12%)
Mutual labels:  django
Django Unifi Portal
Authenticate Unifi WiFi Guests with Django
Stars: ✭ 50 (+0%)
Mutual labels:  django
Drf Recaptcha
Django REST framework reCAPTCHA
Stars: ✭ 47 (-6%)
Mutual labels:  django
Django Celery Tutorial
Django Celery Tutorial
Stars: ✭ 48 (-4%)
Mutual labels:  django
Metaci
Lightweight, Salesforce specific CI app run on Heroku to build Github repositories configured for CumulusCI
Stars: ✭ 45 (-10%)
Mutual labels:  django
Simple S3 Setup
Code examples used in the post "How to Setup Amazon S3 in a Django Project"
Stars: ✭ 46 (-8%)
Mutual labels:  django
Guides
Guides for learning + doing better web and app development. Created by Coding for Entrepreneurs.
Stars: ✭ 1,042 (+1984%)
Mutual labels:  django
Babybuddy
A 👶 buddy to help caregivers track sleep, feedings, diaper changes, and tummy time to learn about and predict baby's needs without (as much) guess work.
Stars: ✭ 1,021 (+1942%)
Mutual labels:  django
Django Todolist
exemplary django application - small to do list web app
Stars: ✭ 47 (-6%)
Mutual labels:  django
Dj Stripe
Django + Stripe Made Easy
Stars: ✭ 1,022 (+1944%)
Mutual labels:  django
Django Access
Django-Access - the application introducing dynamic evaluation-based instance-level (row-level) access rights control for Django
Stars: ✭ 47 (-6%)
Mutual labels:  django
Yesterday I Learned
Brainfarts are caused by the rupturing of the cerebral sphincter.
Stars: ✭ 50 (+0%)
Mutual labels:  django
Spirit
Spirit is a modern Python based forum built on top of Django framework
Stars: ✭ 1,045 (+1990%)
Mutual labels:  django
Wolframwebengineforpython
Integrates the Wolfram Language seamlessly with Python AIOHTTP
Stars: ✭ 48 (-4%)
Mutual labels:  django

============================= django-disposable-email-checker

PyPI version PyPI version Requirements Status

Django package to detect between ~890 & ~8,600 domains used by disposable email services. You can validate any email against our internal list of ~890 domains used by disposable email services. Optionally you can also check each domain against the Block-Disposable-Email.com API, covering ~8,600 domains.

Setup

Install the disposable email checker from PyPI

pip install django-disposable-email-checker

The disposable email checker comes with a list of ~890 emails. If you would like to provide your own email list create a function which returns a list of domains to block.

from disposable_email_checker.emails import email_domain_loader

def custom_email_domain_loader():
    # Anyone still using AOL will be too much of a customer service burden
    return [
        "aol.com",
    ] + email_domain_loader()

Then add the complete path including function name to your settings

DEC_LOADER = "my.package.custom_email_domain_loader"

If you would like to use the BDE integration add your API key to your Django settings

BDEA_APIKEY = "abcnotarealkey123"

optionally you can configure the BDE API timeout in seconds (default 5)

BDEA_TIMEOUT = 2

A default error message can be set globally for the validation checking (this is optional and if left blank it will default to _('Blocked email provider.')):

BDEA_MESSAGE = '<blocked email message>'

Adding to your models

Once you have completed setup add the DisposableEmailField to your models.

from disposable_email_checker.fields import DisposableEmailField

class MyModel(models.Model):
    email = DisposableEmailField()

The DisposableEmailField has a few optional arguments

  • whitelist - A list of emails which will always be allowed. Defaults to []
  • message - The error message used by ValidationError if validation fails. Defaults to _('Blocked email provider.')
  • code - The error code used by ValidationError if validation fails. Defaults to "invalid".

Using the validator

If you want to use the validator by itself

from django.core.exceptions import ValidationError
from disposable_email_checker.validators import validate_disposable_email

try:
    validate_disposable_email(email)
except ValidationError:
    pass
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].