本文整理匯總了Python中models.Email.validate方法的典型用法代碼示例。如果您正苦於以下問題:Python Email.validate方法的具體用法?Python Email.validate怎麽用?Python Email.validate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.Email
的用法示例。
在下文中一共展示了Email.validate方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: messages
# 需要導入模塊: from models import Email [as 別名]
# 或者: from models.Email import validate [as 別名]
def messages():
# Handler for HTTP POST to http://symptomatic.me/messages
api_key = os.environ.get('MAILGUN_APIKEY')
token = request.form.get('token')
signature = request.form.get('signature')
sender = request.form.get('sender')
recipient = request.form.get('recipient')
body_plain = request.form.get('body-plain', '')
timestamp = request.form.get('timestamp')
date = datetime.fromtimestamp(int(timestamp))
e = Email.validate(date=date, sender=sender, body_plain=body_plain, symptoms=body_plain.splitlines())
mongo.save_email(e)
return "OK"
if _verify(api_key=api_key, token=token, timestamp=timestamp, signature=signature):
date = datetime.fromtimestamp(int(timestamp))
e = Email.validate(date=date, sender=sender, body_plain=body_plain, symptoms=body_plain.splitlines())
mongo.save_email(e)
return "OK"
return "Nope", 404