restaurant / app.py
Subbu1304's picture
Create app.py
54b629a verified
raw
history blame contribute delete
784 Bytes
from flask import Flask, render_template, request, redirect, url_for
app = Flask(__name__)
# Route to render signup page
@app.route('/')
def signup_form():
return render_template('signup.html')
# Route to handle signup form submission
@app.route('/signup', methods=['POST'])
def signup():
username = request.form['username']
email = request.form['email']
password = request.form['password']
confirm_password = request.form['confirm_password']
# Simple validation
if password != confirm_password:
return "Passwords do not match. Please try again."
# Here, you would typically add code to store the user's data in a database
return f"Account for {username} created successfully!"
if __name__ == '__main__':
app.run(debug=True)