first commit

This commit is contained in:
Benjamin Sigonneau
2022-05-10 20:45:46 +02:00
commit 7423a26069
5 changed files with 4492 additions and 0 deletions

33
app.py Executable file
View File

@@ -0,0 +1,33 @@
#! /usr/bin/env python3
from bottle import get, post, run, template
import smtplib
def send_confirm_email():
print('Sending confirmation email')
host = 'localhost'
port = 1025
server = smtplib.SMTP(host, port)
FROM = "welcome@superbuzz.com"
TO = "you@example.com"
MSG = """Subject: Welcome to SuperBuzz!
You're just one click away from SuperBuzz bliss! Click this confirmation link:
[confirmation link].
"""
server.sendmail(FROM, TO, MSG)
server.quit()
print('Confimration email sent.')
@get('/')
def home():
return template('home')
@post('/go')
def go():
send_confirm_email()
return template('go')
run(host='localhost', port=8080, debug=True)