Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandar-had authored May 15, 2019
1 parent 3702a4c commit 5aa820c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions webapp/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from flask import Flask, render_template, redirect, url_for, request

from student import Student

students = []

app = Flask(__name__)


@app.route("/", methods = ["GET", "POST"])
def students_page():
if request.method == "POST":
new_student_id = request.form.get("student-id", "")
new_student_name = request.form.get("name", "")
new_student_last_name = request.form.get("last-name", "")

new_student = Student(name=new_student_name, last_name=new_student_last_name, student_id=new_student_id)
students.append(new_student)

return redirect(url_for("students_page"))

return render_template("index.html", students=students)


if __name__ == "__main__":
app.run(debug=True)

0 comments on commit 5aa820c

Please sign in to comment.