跳转到主要内容

A Django reusable app to send email with postmark, as well as models and views to handle bounce integration.

项目描述

django-postmark是一个可重用的应用程序,包含用于通过Django发送电子邮件的EmailBackend以及模型和视图,用于实现与Postmark弹跳钩子API的集成。

安装

您可以使用pip通过输入以下命令安装django postmark:

pip install django-postmark

或者通过easy_install输入以下命令:

easy_install django-postmark

或者手动下载tarball并输入以下命令:

python setup.py install

安装完成后,将postmark添加到您的INSTALLED_APPS并运行

python manage.py syncdb

如果您正在使用south

python manage.py migrate

Django配置

如果您想将django-postmark用作默认的后端,您应该在settings.py中添加以下内容:

EMAIL_BACKEND = "postmark.backends.PostmarkBackend"

设置

django-postmark添加了1个必需设置和2个可选设置。

必需

指定您的Postmark服务器的API密钥。

POSTMARK_API_KEY = 'POSTMARK_API_TEST'
可选

指定视图所需的用户名和密码,该视图将通过基本认证传递。(http://exampleuser:examplepassword@example.com/postmark/bounce/)

POSTMARK_API_USER = "exampleuser"
POSTMARK_API_PASSWORD = "examplepassword"

Postmark Bounce Hook

Postmark具有可选功能,可以在发送的消息弹跳时向URL发送POST请求。django-postmark附带一个urlconf和视图用于此目的。如果您想使用此功能,请添加以下内容:

url(r"^postmark/", include("postmark.urls")),

将此代码添加到您的根urls.py文件中。这将使您的跳转钩子位置位于/postmark/bounce/。然后,只需在Postmark设置中添加URL(如果设置了POSTMARK_API_USER/PASSWORD,则指定用户名和密码)即可,Django将接受来自Postmark的POSTS,通知它有新的跳转。

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

django-postmark-0.1.6.tar.gz (9.3 kB 查看哈希值)

上传时间

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面