一个django可重用的应用程序,它为阻止电子邮件地址提供表单字段、模型和验证器

django-blockedemails的Python项目详细描述


Django BlockedEmails是一个可重用的应用程序,它提供一个表单字段, 验证程序和模型,用于检查电子邮件是否被阻止,或 是一次性的/一次性的。

安装

通过键入:

pip install django-blockedemails

或者通过键入:

easy_install django-blockedemails

或者手动下载tarball并键入:

python setup.py install

设置

django blockededemails添加3个设置

Specifies an API_KEY to use with http://www.block-disposable-email.com/:

BLOCK_DISPOSABLE_EMAIL_API_KEY = "" # Defaults to None which disables this validator

Specifies a different url to use for the block-disposable-email.com api:

BLOCK_DISPOSABLE_EMAIL_URL = "" # Will be string formated with a dictionary with api_key and domain

Specifies if we should block an email if an exception occurs trying to check block-disposable-email.com:

BLOCK_EMAIL_ON_URLERROR = False # Defaults to False

用法

To use the formfield simply import it and use it:

from django import forms
from blockedemails.fields import EmailField

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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
图像处理Java 8 ImageIO在Linux中无法正确读取JPEG   spring如何用Java 1.4兼容版本替换@Resource注释   java Http请求参数类型传播   在web浏览器中看不到Java Maven Tomcatplugin web应用程序   jvm在Java中使用直接内存的目的是什么?   如何从列表转换为字符串java   java setAdapter gridview发送上下文   SwingJava。方法上的lang.NullPointerException   java什么是shell脚本、makefile和ant文件   当使用getGraphics()方法时,java JPanel图形会闪烁   java如何将迭代转换为递归?   java为什么我的抽屉菜单在同一个XML上有ConstraintLayout时没有响应?   java如何在图像上画一个圆?   Android studio:Rabbitmq:Error:java。lang.ClassNotFoundException:类io。千分尺。果心仪器找不到仪表注册表