-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplication.py
More file actions
50 lines (39 loc) · 1.39 KB
/
application.py
File metadata and controls
50 lines (39 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from flask import Flask,render_template,request
import sys
application = Flask(__name__)
@application.route("/")
def hello():
return render_template("index.html")
@application.route("/list")
def view_list():
return render_template("list.html")
@application.route("/review")
def view_review():
return render_template("review.html")
@application.route("/reg_items")
def reg_item():
return render_template("reg_items.html")
@application.route("/reg_reviews")
def reg_review():
return render_template("reg_reviews.html")
@application.route("/submit_item_post", methods=['POST'])
def reg_item_submit_post():
image_file=request.files["file"]
image_file.save("static/images/{}".format(image_file.filename))
data=request.form
return render_template("submit_item_result.html", data=data,
img_path="static/images/{}".format(image_file.filename))
@application.route("/submit_item")
def reg_item_submit():
name=request.args.get("name")
seller=request.args.get("seller")
addr=request.args.get("addr")
email=request.args.get("email")
category=request.args.get("category")
card=request.args.get("card")
status=request.args.get("status")
phone=request.args.get("phone")
print(name,addr,phone,category,status)
#return render_template("reg_item.html")
if __name__ == "__main__":
application.run(host='0.0.0.0', debug=True)