Skip to content

Instantly share code, notes, and snippets.

@henryfjordan
henryfjordan / contact.py
Last active January 5, 2021 15:20
Python Contact Form Handler
from flask import Flask, request
import httplib, urllib
import psycopg2
#Helper Function to send a push notification using Pushover
def _pushover(name, email, message):
http_connection = httplib.HTTPSConnection("api.pushover.net:443")
http_connection.request("POST", "/1/messages.json",
urllib.urlencode({
"token": "INSERT_TOKEN_HERE",