In my signup form of my website, I'd like to check whether the person inputs an 'email' and not anything else. This is my signup function in python:
@app.route('/Signup', methods=['POST', 'GET'])
def signup():
if request.method == 'POST':
if request.form['password'] == request.form['repeatpass']:
_insertuser(request.form['name'], request.form['email'], request.form['password'], request.form['repeatpass'])
return render_template('SignedUp.html')
else:
session['credentials wrong'] = True
return render_template('Signup.html')
else:
session['credentials wrong'] = False
return render_template('Signup.html')
In most cases people use regex, however I find regex slightly complicated and would like to know if there is a simpler way to do this.