#!/bin/python3 import sqlite3 from flask import Flask, session, redirect, url_for, escape, request app = Flask(__name__) conn = sqlite3.connect('../mailing_list') c = conn.cursor() @app.route('/subscribe') def login(): return '''
''' @app.route('/added_email', methods=['POST']) def hello(): email = request.form['email'] studie = request.form['studie'] query = "insert into mails (email, studie) values (?, ?)" c.execute(query, (email, studie)) conn.commit() conn.close() return 'I inserted: %s and %s, into the database' % (email, studie) if __name__ == '__main__': app.run(port=2047)