COIMBATORE INSTITUTE OF TECHNOLOGY-python Project
COIMBATORE INSTITUTE OF TECHNOLOGY-python Project
PYTHON PROJECT
“ ARUSUVAI ”
“A FOOD DELIVERY
WEBSITE”
TEAM MEMBERS:
AANIRUDH.P
DIVAKAR.R
DEEPAVIASH.R
“Arusuvai”
Aim:
To provide an easy-to-use platform for
users to explore and order from a variety of
restaurants.
To enable administrators to manage
restaurant listings, including adding, editing,
and deleting details.
To integrate features like location tracking
and search to enhance user experience.
The user can select his own delivery man
from the available list.
Source Code:
app = Flask(__name__)
def hash_password(password):
return hashlib.sha256(password.encode()).hexdigest()
if connection.is_connected():
cursor = connection.cursor()
# SQL query to insert data
insert_query = """
INSERT INTO user (first_name, last_name, contact, email, password,
address)
VALUES (%s, %s, %s, %s, %s, %s)
"""
cursor.execute(insert_query, (first_name, last_name, contact, email,
hash_password(password), address))
# Commit the transaction
connection.commit()
except Error as e:
print(f"Error: {e}")
finally:
if connection.is_connected():
cursor.close()
connection.close()
@app.route('/')
def home():
return render_template('signup.html')
@app.route('/signup', methods=['POST'])
def signup():
if request.method == 'POST':
# Get form data
first_name = request.form['name']
last_name = request.form['lname']
contact = request.form['contact']
email = request.form['email']
password = request.form['password']
address = request.form['address']
return redirect(url_for('login'))
@app.route('/login')
def login():
return render_template('login.html')
def open_browser():
webbrowser.open_new('http://127.0.0.1:5000/')
if __name__ == '__main__':
Timer(1, open_browser).start()
app.run()
CONCLUSION:
This food website successfully meets its objective of
providing a convenient and engaging platform for users to
browse and order food from local restaurants.