skip to navigation
skip to content

django-bdemails 1.0.6

A Django reusable app that provides a form field and validators that check if an email is disposable/throwaway.

# Django BDEmails

[django-bdemails](https://bdemails.com/console/integration) is an app that provides a form field and
validators that check if an email is disposable/throwaway.

### Installation

You can install django-bdemails with pip by typing

```
pip install django-bdemails
```

Or with easy_install by typing

```
easy_install django-bdemails
```

Or manually by downloading a tarball and typing

```
python setup.py install
```

### Settings

django-bdemails adds 7 settings

Specifies an API Key to use with [BDEmails](https://bdemails.com)

```
BDEMAILS_API_KEY = "" # Defaults to None which disables this validator
```

Specifies a different URL to use for the [BDEmails](https://bdemails.com) API

```
BDEMAILS_URL = "" # Defaults to "https://bdemails.com/api/json/%(api_key)s/%(domain)s"
```

Specifies if we should block an email if an exception occurs trying to check [BDEmails](https://bdemails.com)

```
BDEMAILS_URLERROR = False or True # Defaults to False
```

Specifies what message should appear if the domain is blocked

```
BDEMAILS_BLOCKED_MESSAGE = "" # Defaults to "Disposable emails are not allowed. Please try again."
```

Specifies what message should appear if the domain is not exists

```
BDEMAILS_NOT_EXISTS_MESSAGE = "" # Defaults to "Disposable emails are not allowed. Please try again."
```

Specifies what message should appear if the domain has no MX record

```
BDEMAILS_NO_MX_MESSAGE = "" # Defaults to "You entered an email that has no MX record. Please try again."
```

Specifies what message should appear if the domain is a free email service provider (and is not allowed in your own whitelist list)

```
BDEMAILS_FESP_MESSAGE = "" # Defaults to "This free email service provider is blocked. Please try again."
```

### Usage

To use the formfield simply import it and use it

```
from django import forms
from bdemails.fields import EmailField

class ExampleForm(forms.Form):
email = EmailField()
```

### Credits

* **Donald Stufft** - [dstufft](https://github.com/dstufft)  
File Type Py Version Uploaded on Size
django-bdemails-1.0.6.tar.gz (md5) Source 2017-07-30 3KB