-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
27 lines (21 loc) · 794 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
from flask import Flask, render_template, request, json
app = Flask(__name__)
@app.route("/")
def main():
return render_template('index.html')
@app.route('/showSignup')
def showSignup():
return render_template('signup.html')
@app.route('/signUp', methods=['POST'])
def signUp():
# read the posted values from the UI
_name = request.form['inputName']
_email = request.form['inputEmail']
_password = request.form['inputPassword']
# validate the received files
if _name and _email and _password:
return json.dumps({'html':'<span>All fields good !!</span>'})
else:
return json.dumps({'html':'<span>Enter the required fields</span>'})
if __name__ == "__main__":
app.run()