Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ongsici committed Oct 21, 2024
1 parent a495fa2 commit eb3cdc1
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/app.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
from flask import Flask, render_template, request
app = Flask(__name__)


@app.route("/")
def hello_world():
return render_template("index.html")


@app.route("/submit", methods=["POST"])
def submit():
input_name = request.form.get("name")
input_age = request.form.get("age")
input_gender = request.form.get("gender")
input_happiness = request.form.get("happy")
if int(input_happiness) >= 0:
return render_template("happy.html", name=input_name, age=input_age, gender=input_gender, happy=input_happiness)
return render_template("happy.html",
name=input_name,
age=input_age,
gender=input_gender,
happy=input_happiness)
else:
return render_template("sad.html", name=input_name, age=input_age, gender=input_gender, happy=input_happiness)
# if __name__ == '__main__':
# app.run(host= "0.0.0.0",port=8000)
return render_template("sad.html",
name=input_name,
age=input_age,
gender=input_gender,
happy=input_happiness)
# if __name__ == '__main__':
# app.run(host= "0.0.0.0",port=8000)

0 comments on commit eb3cdc1

Please sign in to comment.