b94a09d by deepti at 2013-07-03 |
1 |
from flask import Flask |
|
2 |
from flask import render_template |
|
3 |
from flask import request |
|
4 |
from flask import url_for |
|
5 |
from flask import send_file |
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
app = Flask(__name__) |
|
10 |
|
|
11 |
@app.route("/add",methods=['GET','POST']) |
|
12 |
def hello1(): |
|
13 |
if request.method=='GET': |
|
14 |
return render_template("HampiGirijakalyana.html") |
|
15 |
elif request.method=='POST': |
|
16 |
print request.form |
|
17 |
return "OK" |
|
18 |
|
|
19 |
|
|
20 |
@app.route("/daten.xml") |
|
21 |
def data(): |
|
22 |
return send_file("./static/daten.xml") |
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
#syntax |
|
27 |
if __name__ == "__main__": |
|
28 |
app.run(debug=True) # for relaoder enable donot have to re run python program from bash everytime refreshing will do if debug=True |