Skip to content

Instantly share code, notes, and snippets.

View mcroni's full-sized avatar
💭
DjangoNaut

kojo mcroni mcroni

💭
DjangoNaut
View GitHub Profile
@mcroni
mcroni / send_mailgun_attachments.py
Created August 18, 2019 23:08 — forked from adamlj/send_mailgun_attachments.py
MailGun API Python Requests multiple Attachments Send mail with multiple files/attachments with custom file names
requests.post("https://api.mailgun.net/v2/DOMAIN/messages",
auth=("api", "key-SECRET"),
files={
"attachment[0]": ("FileName1.ext", open(FILE_PATH_1, 'rb')),
"attachment[1]": ("FileName2.ext", open(FILE_PATH_2, 'rb'))
},
data={"from": "FROM_EMAIL",
"to": [TO_EMAIL],
"subject": SUBJECT,
"html": HTML_CONTENT
@mcroni
mcroni / celery.sh
Created October 1, 2019 14:16 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),