Add testapp.py
This commit is contained in:
parent
03a97976d0
commit
9faf48b7f2
26
testapp.py
Normal file
26
testapp.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
from flask import Flask, render_template, request
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@app.route('/', methods=['GET', 'POST'])
|
||||||
|
def home():
|
||||||
|
if request.method == 'POST':
|
||||||
|
college_name = request.form['college_name']
|
||||||
|
student_name = request.form['student_name']
|
||||||
|
course_name = request.form['course_name']
|
||||||
|
year_of_study = request.form['year_of_study']
|
||||||
|
|
||||||
|
return f"College: {college_name}, Student: {student_name}, Course: {course_name}, Year: {year_of_study}"
|
||||||
|
|
||||||
|
return '''
|
||||||
|
<form method="POST">
|
||||||
|
College Name: <input type="text" name="college_name"><br>
|
||||||
|
Student Name: <input type="text" name="student_name"><br>
|
||||||
|
Course Name: <input type="text" name="course_name"><br>
|
||||||
|
Year of Study: <input type="text" name="year_of_study"><br>
|
||||||
|
<input type="submit" value="Submit">
|
||||||
|
</form>
|
||||||
|
'''
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
app.run(debug=True, host="0.0.0.0", port=5000) # This allows the app to run inside the container
|
Loading…
Reference in New Issue
Block a user