-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathflask_test.py
35 lines (31 loc) · 956 Bytes
/
flask_test.py
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
#coding=utf-8
from flask import Flask, render_template, request, jsonify
import Random_sampling
import get_history_num
app = Flask(__name__)
@app.route('/',methods=['GET','POST'])
def index():
if request.method == 'GET':
return render_template('index.html')
else:
pass
@app.route('/admin369369',methods=['GET','POST'])
def admin():
if request.method == 'GET':
return render_template('admin369369.html')
else:
pass
@app.route('/get_num',methods=['GET'])
def get_num():
list = Random_sampling.random_sampling()
list_num = []
list_num.append(list)
return jsonify(res = list_num)
@app.route('/clean_data',methods=['GET'])
def clean_data():
information = '清理完毕,现有:' + str(get_history_num.get_history_data()) + '注未开'
list_num = []
list_num.append(information)
return jsonify(res = list_num)
if __name__ == '__main__':
app.run(host='0.0.0.0',debug=True)