-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
31 lines (20 loc) · 628 Bytes
/
app.py
File metadata and controls
31 lines (20 loc) · 628 Bytes
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
from flask import Flask,render_template,request
app=Flask(__name__)
@app.route('/')
def index():
return '''
<html>
<body>
<form action="/greet" method="POST">
Enter your name: <input type="text" name="username">
<input type="submit" value="Submit">
</form>
</body>
</html>
'''
@app.route('/greet',methods=['POST'])
def greet():
user_input=request.form['username']
return f'Hello, {user_input}! Welcome to our website.'
if __name__=='__main__':
app.run(host='0.0.0.0',port=5000)