Created
December 14, 2016 02:02
-
-
Save plasx/c7276f6ebddf9b82611029caca0ed707 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import sqlite3 | |
from flask import Flask, render_template | |
app = Flask(__name__) | |
conn = sqlite3.connect('example.db') | |
c = conn.cursor() | |
c.execute('''CREATE TABLE emails | |
(name text, email text)''') | |
c.execute("INSERT INTO emails VALUES ('melinda gates', '[email protected]')") | |
conn.commit() | |
@app.route("/") | |
def hello(name="HAPPPPPPY"): | |
return render_template('hello.html',name=name) | |
@app.route("/MO") | |
def MO(): | |
return "string" | |
if __name__ == "__main__": | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://docs.python.org/2/library/sqlite3.html
virtualenv venv
source venv/bin/activate
pip install flask
python app.py