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 |
from flask import url_for |
5 |
from flask import send_file |
6 |
|
7 |
|
8 |
|
9 |
app = Flask(__name__) |
10 |
|
11 |
@app.route("/") |
12 |
def hello(): |
13 |
return("We are in Bengalaru") |
14 |
|
15 |
|
16 |
@app.route("/add",methods=['GET','POST']) |
17 |
def hello1(): |
18 |
if request.method=='GET': |
19 |
return render_template("HampiGirijakalyana.html") |
20 |
elif request.method=='POST': |
21 |
print request.form |
22 |
return "OK" |
23 |
|
24 |
|
25 |
@app.route("/daten.xml") |
26 |
def data(): |
27 |
return send_file("./static/daten.xml") |
28 |
|
29 |
|
30 |
|
31 |
#syntax |
32 |
if __name__ == "__main__": |
33 |
app.run(debug=True) # for relaoder enable donot have to re run python program from bash everytime refreshing will do if debug=True |