-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
30 lines (26 loc) · 1022 Bytes
/
app.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
from flask import Flask, render_template , request
import diabetes
# from flask.wrappers import Request
app = Flask(__name__)
@app.route("/", methods=['GET', 'POST'])
def home():
if request.method=="POST":
Pregnancies = request.form['Preg']
Glucose = request.form['glc']
BloodPressure = request.form['bp']
SkinThickness = request.form['skinc']
Insulin = request.form['insulin']
BMI = float(request.form['bmi'])
DiabetesPedigreeFunction = float(request.form['dpf'])
Age = request.form['age']
data = (Pregnancies, Glucose, BloodPressure, SkinThickness, Insulin, BMI, DiabetesPedigreeFunction, Age)
result = diabetes.diabetes_prediction(data)
return render_template("submit.html", res = result)
else:
return render_template("index.html")
@app.route("/submit", methods=['GET', 'POST'])
def submit():
if request.method == "POST":
return render_template('index.html')
if __name__ == "__main__":
app.run()