0% found this document useful (0 votes)
18 views4 pages

COIMBATORE INSTITUTE OF TECHNOLOGY-python Project

The document outlines a Python project named 'Arusuvai', a food delivery website aimed at simplifying the process of exploring and ordering from various restaurants. It includes features for user registration, restaurant management, and location tracking to enhance user experience. The project demonstrates successful implementation of these functionalities, providing a convenient platform for food ordering.

Uploaded by

71762331016
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views4 pages

COIMBATORE INSTITUTE OF TECHNOLOGY-python Project

The document outlines a Python project named 'Arusuvai', a food delivery website aimed at simplifying the process of exploring and ordering from various restaurants. It includes features for user registration, restaurant management, and location tracking to enhance user experience. The project demonstrates successful implementation of these functionalities, providing a convenient platform for food ordering.

Uploaded by

71762331016
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

COIMBATORE INSTITUTE OF TECHNOLOGY

COIMBATORE – 641 004.

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:

from flask import Flask, render_template, request, redirect, url_for


import mysql.connector
from mysql.connector import Error
import hashlib
import webbrowser
from threading import Timer

app = Flask(__name__)

def hash_password(password):
return hashlib.sha256(password.encode()).hexdigest()

def insert_user(first_name, last_name, contact, email, password, address):


try:
connection = mysql.connector.connect(
host='localhost', # Your MySQL host
database='aani', # Your database name
user='root', # Your MySQL username
password='' # Your MySQL password
)

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']

insert_user(first_name, last_name, contact, email, password, 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.

 With dynamic features such as restaurant management for


administrators, location tracking, and a user-friendly
interface, the website enhances the food ordering
experience.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy