Created
December 14, 2016 01:58
-
-
Save plasx/b4111e3a032714bb2721194a4fc2198b to your computer and use it in GitHub Desktop.
pelotonCode
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("SELECT * FROM emails") | |
conn.commit() | |
@app.route("/") | |
def hello(name="HAPPPPPPY"): | |
return render_template('hello.html',name=name) | |
@app.route("/MO") | |
def MO(): | |
return "strinsadfadsfadsfadsfadsfdasg" | |
@app.route("/MO/cypher") | |
def JIMMY(): | |
rose = c.fetchone() | |
return str(rose[0] + rose[1]) | |
if __name__ == "__main__": | |
app.run(host='0.0.0.0') |
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