var settings = {
"async": true,
"crossDomain": true,
"url": "YOUR_BULLIT_URL",
"method": "POST",
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gandi subdomain DNS configuration for Mailgun validation | |
# - Add the SPF record as TXT and SPF | |
# - Suffix the DKIM record and `email` CNAME with the subdomain | |
# ex: `mg.domain.com` | |
mg 10800 IN CNAME mailgun.org. | |
@ 10800 IN SPF "v=spf1 include:mailgun.org ~all" | |
@ 10800 IN TXT "v=spf1 include:mailgun.org ~all" | |
mailo._domainkey.mg 10800 IN TXT "k=rsa; p=MIG...QAB" | |
email.mg 10800 IN CNAME mailgun.org. | |
@ 10800 IN MX 10 mxa.mailgun.org. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
import time | |
def makeDate(created_at): | |
tst = time.strptime(created_at,'%a %b %d %H:%M:%S +0000 %Y') | |
dt = datetime.fromtimestamp(time.mktime(tst)) | |
return dt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stdlib | |
from json import dumps | |
def to_json(model): | |
""" Returns a JSON representation of an SQLAlchemy-backed object. | |
""" | |
json = {} | |
json['fields'] = {} | |
json['pk'] = getattr(model, 'id') | |