This file looks large and may slow your browser down if we attempt
to syntax highlight it, so we are showing it without any
pretty colors.
Highlight
it anyway.
1 |
from flask import Flask |
2 |
from flask import render_template |
3 |
from flask import request |
4 |
app = Flask(__name__) |
5 |
|
6 |
@app.route("/") |
7 |
def hello(): |
8 |
return "Hello World!" |
9 |
|
10 |
@app.route("/add",methods = ['GET','POST']) |
11 |
def add(): |
12 |
if request.method == "GET": |
13 |
return render_template("form.html") |
14 |
elif request.method == "POST": |
15 |
print request.form |
16 |
return "OK" |
17 |
|
18 |
if __name__ == "__main__": |
19 |
app.run() |
20 |
|