ANJALITRIAL102
ANJALITRIAL102
ANJALITRIAL102
REPORT
ON
C LANGUAGE
Submitted in partial fulfillment towards the award of degree in
B.TECH in Computer Science and Engineering
SESSION 2023-24
ODD SEMESTER
SUBMITTED BY :
ROLL NO.:
INDEX
i
ii
ABOUT ORGANIZATION
iii
ACKNOWLEDGEMENT
It is my pleasure to be indebted to various people, who directly or indirectly
contributed in the development of this work and who influenced my
thinking, behavior, and acts during the course of study.
(Sign of Student)
iv
CERTIFICATE
v
DECLARATION
I, ARJUN SINGH hereby declare that the presented report of Internship
titled “PYTHON” is uniquely prepared by me after the completion of 4
WEEK on the platform of SPI.
I also confirm that the report is only prepared for my academic requirement,
not for any other purpose. It might not be used with the interest of the
opposite party of the any organization.
(Sign of Student)
vi
TECHNOLOGIES TRAINED ON DURING
SUMMER TRAINING
1. HTML: - HTML stand for hypertext markup language, this markup language is
used to design static web pages. HTML contain pre-defined tags, which are useful
to design web pages. HTML describes the structure of a Web page. HTML
consists of a series of elements. HTML elements tell the browser how to display
the content. HTML elements label pieces of content such as "this is a heading",
"this is a paragraph", "this is a link", etc.
2. CSS: - CSS stands for Cascading Style Sheets. CSS describes how HTML
elements are to be displayed on screen, paper, or in other media.CSS is the
language we use to style an HTML document. CSS describes how HTML
elements should be displayed. CSS saves a lot of work. It can control the layout of
multiple web pages all at once. External stylesheets are stored in CSS files.
3. C Language: - C is a general-purpose programming language created by
Dennis Ritchie at the Bell Laboratories in 1972. It is a very popular language,
despite being old. C is strongly associated with UNIX, as it was developed to
write the UNIX operating system. It is one of the most popular programming
language in the world. If you know C, you will have no problem learning other
popular programming languages such as Java, Python, C++, C#, etc, as the syntax
is similar. C is very fast, compared to other programming languages, like Java and
Python C is very versatile; it can be used in both applications and technologies.
4. Javascript: - JavaScript is a scripting or programming language that allows
you to implement complex features on web pages — every time a web page does
more than just sit there and display static information for you to look at —
displaying timely content updates, interactive maps, animated 2D/3D graphics,
scrolling video jukeboxes, etc. — you can bet that JavaScript is probably
involved. It is the third layer of the layer cake of standard web technologies, two
of which (HTML and CSS).
5. Bootstrap: - Bootstrap is the most popular HTML, CSS and JavaScript
framework for developing a responsive and mobile friendly website. It is
absolutely free to download and use. It is a front-end framework used for easier
and faster web development. It includes HTML and CSS based design templates
1
for typography, forms, buttons, tables, navigation, modals, image carousels and
many others. It can also use JavaScript plug-ins. It facilitates you to create
responsive designs.
6. Database: - A database is an organized collection of data, so that it can be
easily accessed and managed. You can organize data into tables, rows, columns,
and index it to make it easier to find relevant information. Database handlers
create a database in such a way that only one set of software program provides
access of data to all the users. The main purpose of the database is to operate a
large amount of information by storing, retrieving, and managing data. There are
many dynamic websites on the World Wide Web nowadays which are handled
through databases. For example, a model that checks the availability of rooms in a
hotel. It is an example of a dynamic website that uses a database. There are many
databases available like MySQL, Sybase, Oracle, MongoDB, Informix,
PostgreSQL, SQL Server, etc.
7. Python: - Python programming language is a high level, object-oriented
programming language with dynamic semantics. It is the main technology of my
internship. Python is a general purpose programming language which is useful to
develop following types of applications:-
Desktop application
Web application
Data Science and data visualization
Machine Learning
Embedded System
Robotics
Physical computing
Internet of Things (IOT)
Game Development.
2
specific logics, whereas if you develop software application using framework then
you need to write only application specific logic and framework take care of
common logics. Django is a web framework which follows MVT (Model – View -
Template) pattern. Explanation of MVT is given below:-
3
CHAPTER 1: INTRODUCTION
This project is a web based shopping system for an existing shop. The project objective is
to deliver the online shopping application into android platform. Online shopping is the
process whereby consumers directly buy goods or services from a seller in real-time,
without an intermediary service, over the Internet. It is a form of electronic commerce.
This project is an attempt to provide the advantages of online shopping to customers of a
real shop. It helps buying the products in the shop anywhere through internet by using an
android device. Thus the customer will get the service of online shopping and home
delivery from his favorite shop
OBJECTIVES
People in large number are doing online shopping today, and it is not only because it is
convenient as one can shop from home, but also because there is an ample number of
varieties available, with a high competition of prices, and also it is easy to navigate for
searching regarding any particular item.
For sellers, their product has access to the World-Wide market, which also increases the
number of customers and enhances customer relationships. Also, web stores are a means
for small-scale companies to launch their products at the global level. The main objective
of this project is to develop a web-oriented application that can provide an online
shopping feature to users.
In other words, the project aimed at creating a virtual shop environment for users, in some
handy form, which will be available to them through the internet. Although the idea of
developing online shopping websites is not new in the electronic market and has been
evolved soon after the World Wide Web (www).
4
Problems in Existing System
The present scenario for shopping is to visit the shops and market manually and then from
the available product list one needs to choose the item he or she wants and then pay for
the same item mainly in cash mode is done, as not every society is well educated and
aware to use net banking or card modes or wallets etc.
This system is not much user-friendly as one needs to go to the market physically and
then select items only from the available list. So mostly it is difficult to get the product as
per our desire. Description About the products is less available and are mostly verbal
only. For this type of shopping, one needs to have an ample amount of free time.
Also, not really good markets exist everywhere, so many times good markets become out
of reach for certain people. In the proposed system customers need not go to the shops for
purchasing the products. He/she can order the product he/she wishes to buy through the
use of this system. The shop owner can be the admin of the system.
The shop owner can appoint officials particularly to handle this, who will help the
owner in managing the customers and product orders. The system also endorses a
home delivery system for delivering the purchased products.
5
Proposed System
In the proposed system customer need not go to the shop for buying the products. He can
order the product he wish to buy through the application in his Smartphone. The shop
owner will be admin of the system. Shop owner can appoint moderators who will help
owner in managing the customers and product orders. The system also recommends a
home delivery system for the purchased products.
This system can be implemented to any shop in the locality or to multinational branded
shops having retail outlet chains. The system recommends a facility to accept the orders
24*7 and a home delivery system which can make customers happy. If shops are
providing an online portal where their customers can enjoy easy shopping from
anywhere, the shops won’t be losing any more customers to the trending online shops
such as Flipkart or ebay. Since the application is available in the Smartphone it is easily
accessible and always available.
Features
6
1. Provides the searching facility based on various type of product to customers.
2. Online shopping system also manages the various type of product to customer.
3. It tracks all the information of various types of products to the end customers.
4. Manages the information of customers.
5. Shows the information and description of the various types of products to customer.
6. To increase efficiency of managing the e-commerce platform.
7. It deals with monitoring the information and transaction of payments.
8. Adding, Editing, and updating of records is improved which results in proper resource
management of online shopping system data.
7
ABOUT THE PROJECT
This Project is an online shopping system. The analysis steps of project are given below:-
By providing the web based application, all the users will get a very good facility of
accessing the service to fulfil their requirements. All the user information, information
sharing and selection process is done properly.
Users will feel comfortable by reduction of their work. The system will make handling of
large databases easy. Losing of records will be avoided. Considering all these factors, we
can conclude that all the users and end users will be satisfied by the system.
For the design and development of the system, several software products have been
accommodated.
Database design – SQLite
Interface design – HTML, CSS, Java Script and Bootstrap.
Coding – Python with django framework.
The technology (Python with django framework) has enough efficiency for the
development of the system. Therefore the project is technically feasible.
The duration of time required for the project has been planned appropriately and it is the
same as the duration of time expected by the client. Therefore the website can be
delivered to the client within the expected time duration, satisfying the client. Hence the
project is feasible in scheduling.
8
1.4 Economic Feasibility: -
According to the resources available and the project scheduling process it is estimated
that the expenses allocated for the web application to be developed, by the client is
sufficient enough. Hence the economical factor has been considered feasible.
Planning is very important part of any software development. In the planning phase, we
decide which features are to be included in the system to make a good system, how much
time do we need to complete the project, what will the cost of the system etc…
A Software Life Cycle or software process is a series of identifiable stages that a software
product undergoes during its development. A software product development effort
usually starts with a project identification and selection stage and then requirements
analysis; design, coding, testing, implementation and maintenance are
undertaken.
A life cycle model identifies all the activities required to develop and maintain a software
product and establishes a precedence ordering among the different activities.
The various phases of Software Development Life Cycle-
Requirement Analysis
System Design
Coding
Testing
Implementation
9
Snap Shots
HOME PAGE
REGISTRATION PAGE
10
LOGIN PAGE
11
CHANGE PASSWORD PAGE
MY ORDERS PAGE
12
MY CART PAGE
PRODUCTS PAGE
13
Coding
models.py
import datetime
class Customer(models.Model):
name=models.CharField(max_length=50)
gender=models.CharField(max_length=6)
address=models.TextField()
pincode=models.IntegerField()
contactno=models.CharField(max_length=15)
emailaddress=models.EmailField(max_length=50,primary_key=True)
regdate=models.DateTimeField(auto_now_add=True)
14
def is_exists(self):
if Customer.objects.filter(emailaddress=self.emailaddress):
return True
else:
False
@staticmethod
def get_customer_by_email(email):
return Customer.objects.get(emailaddress=email)
class Login(models.Model):
userid=models.CharField(max_length=50,primary_key=True)
password=models.CharField(max_length=20)
usertype=models.CharField(max_length=30)
class Category(models.Model):
name= models.CharField(max_length=50)
def __str__(self):
return self.name
@staticmethod
def get_all_category():
return Category.objects.all()
15
class Product(models.Model):
name= models.CharField(max_length=50)
price= models.IntegerField(default=0)
desc =models.CharField(max_length=200)
image= models.ImageField(upload_to='newproducts/')
@staticmethod
def get_products_by_categoryid(category_id):
return Product.objects.filter(category=category_id)
@staticmethod
def get_all_products():
return Product.objects.all()
@staticmethod
def get_product_by_id(productid):
return Product.objects.get(id=productid)
class Orders(models.Model):
customer=models.ForeignKey(Customer,on_delete=models.DO_NOTHING)
product=models.ForeignKey(Product,on_delete=models.DO_NOTHING)
price=models.IntegerField()
address=models.CharField(max_length=200)
pincode=models.CharField(max_length=10)
quantity= models.IntegerField()
order_date=models.DateField(default=datetime.datetime.today)
16
completed= models.BooleanField(default=False)
class ShoppingCart(models.Model):
quantity = models.IntegerField()
admin.py
class AdminProduct(admin.ModelAdmin):
list_display=['name','price','desc','image']
class AdminCategory(admin.ModelAdmin):
list_display=['name']
class AdminCustomer(admin.ModelAdmin):
return False
return False
class AdminOrders(admin.ModelAdmin):
list_display=['customer','product','price','quantity','order_date']
17
class AdminShoppingCart(admin.ModelAdmin):
admin.site.register(Login)
admin.site.register(Customer,AdminCustomer)
admin.site.register(Product,AdminProduct)
admin.site.register(Category,AdminCategory)
admin.site.register(ShoppingCart, AdminShoppingCart)
admin.site.register(Orders, AdminOrders)
ossappurls.py
urlpatterns=[
path('',views.index,name='index'),
path('about/',views.about,name='about'),
path('product/',views.productPage,name='product'),
path('user/',views.user, name='user'),
path('orders/',views.orders, name='orders'),
path('update_cart/',views.update_cart, name='update_cart'),
views.py
def index(request):
return render(request,'index.html')
def about(request):
return render(request,'about.html')
def productPage(request):
if request.method == "POST":
return redirect('product')
19
else:
category_id=request.GET.get('category')
data = {}
if category_id:
products= Product.get_products_by_categoryid(category_id)
else:
products = Product.get_all_products()
category = Category.get_all_category()
data['products'] = products
data['category'] = category
def register(request):
if request.method == 'POST':
err=None
name= request.POST.get('name')
email = request.POST.get('email')
passwd = request.POST.get('password')
addr = request.POST.get('address')
pin = request.POST.get('pincode')
phone = request.POST.get('phone')
gen = request.POST.get('gender')
20
#Validation
values={'name':name,
'email':email,
'addr':addr,
'pin':pin,
'phone':phone,
'gen':gen,}
password=passwd)
if not name.isalpha():
if not pin.isnumeric():
if customer.is_exists():
data={}
data['err']=err
data['values']=values
if err:
21
#customer.password=make_password(passwd)
customer.save()
myuser.save()
else:
def signin(request):
if request.method == 'POST':
email = request.POST.get('email')
password = request.POST.get('password')
login(request, myuser)
try:
cart=ShoppingCart.objects.filter(customer=Customer.objects.get(emailaddress=request.us
er.username))
except Exception as e:
print(e)
cart=[]
22
request.session['cart']=len(cart)
return redirect('user')
else:
msg="Incorrect Id or password"
return render(request,'login.html',{'msg':msg})
return render(request,'login.html')
@login_required(redirect_field_name='login')
def user(request):
customer = Customer.get_customer_by_email(request.user.username)
data={}
if request.method=='POST':
msg=None
err=None
current_password=request.POST.get('current_password')
new_password = request.POST.get('new_password')
confirm_password = request.POST.get('confirm_password')
if customer.password==current_password:
if new_password==confirm_password:
customer.password=new_password
customer.save()
myuser=User.objects.get(username=request.user.username)
myuser.password=make_password(new_password)
23
myuser.save()
else:
else:
data['customer']=customer
return render(request,'user.html',data)
@login_required(redirect_field_name='login')
def orders(request):
orders=Orders.objects.filter(customer=request.user.username).order_by('-order_date')
return render(request,'orders.html',{'orders':orders})
@login_required(redirect_field_name='login')
def changepass(request):
return render(request,'changepass.html')
def signout(request):
logout(request)
request.session.flush()
return redirect('index')
24
@login_required(redirect_field_name='login')
def buynow(request):
data={}
if request.method=='GET':
total=request.GET.get('total')
if int(total) < 1:
return redirect('/mycart/?err='+err)
method = "add_to_cart"
customer = Customer.get_customer_by_email(request.user.username)
cart=ShoppingCart.objects.filter(customer=customer)
data['cart']=cart
else:
method = "buy_now"
productid=request.POST.get('product')
#print(productid)
product=Product.get_product_by_id(productid)
email=request.user.username
customer=Customer.get_customer_by_email(email)
data['product']=product
data['customer']=customer
25
data['method']=method
return render(request,'confirm.html',data)
@login_required(redirect_field_name='login')
def checkout(request):
if request.method=='GET':
customer = Customer.get_customer_by_email(request.user.username)
cart = ShoppingCart.objects.filter(customer=customer)
price=items.product.price, address=items.customer.address,
pincode=items.customer.pincode)
order.save()
ShoppingCart.objects.filter(customer=Customer.get_customer_by_email(request.user.use
rname)).delete()
request.session['cart'] = 0
else:
product=Product.get_product_by_id(request.POST.get('productid'))
customer =Customer.get_customer_by_email(request.POST.get('email'))
quantity = request.POST.get('quantity')
order=Orders(customer=customer,product=product,price=product.price,address=custome
r.address,pincode=customer.pincode,quantity=quantity)
26
order.save()
return render(request,'checkout.html')
@login_required(redirect_field_name='login')
def mycart(request):
category=request.GET.get('category')
product = Product.objects.get(id=request.GET.get('product_id'))
customer = Customer.get_customer_by_email(request.user.username)
cart.save()
print(request.session.get('cart'))
request.session['cart']=request.session.get('cart')+1
return redirect('/product/?msg='+msg+'&category='+category)
cart=ShoppingCart.objects.filter(customer=Customer.objects.get(emailaddress=request.us
er.username))
return render(request,'mycart.html',{'cart':cart,'total':total})
27
@login_required(redirect_field_name='login')
def update_cart(request):
err=None
if request.method=='POST':
cart_item_id=request.POST.get('cart_item_id')
quantity=request.POST.get('quantity')
if int(quantity) > 0:
cart=ShoppingCart.objects.get(id=cart_item_id)
cart.quantity=quantity
cart.save()
return redirect('mycart')
else:
cart_item_id=request.GET.get('cart_item')
try:
ShoppingCart.objects.get(id=cart_item_id).delete()
request.session['cart'] = request.session.get('cart') -1
except Exception as e:
print(e)
pass
else:
try:
28
ShoppingCart.objects.filter(customer=Customer.get_customer_by_email(request.user.use
rname)).delete()
request.session['cart'] = 0
err="Cart Empty"
except Exception as e:
pass
if err:
return redirect('/mycart/?err='+err)
else:
return redirect('/mycart/')
base.html
<!doctype html>
<html lang="en">
{% load static %}
<head>
<meta charset="utf-8">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css"
29
integrity="sha512-
1sCRPdkRXhBV2PBLUdRb4tMg1w2YPf37qatUFeS7zlBy7jJI8Lf4VHwWfZZfpXtYSL
y85pkm9GaYVYMfw5BC1A==" crossorigin="anonymous" referrerpolicy="no-
referrer" />
</head>
<body>
<div class="container-fluid">
{% include 'navbar.html' %}
{% block content %}
{% endblock %}
{% include 'footer.html' %}
</div>
</body>
</html>
changepass.html
{% extends "userbase.html" %}
{% block page_title %}
Change Password
30
{% endblock %}
{% block user %}
{% if err %}
{{err}}
</div>
{% endif %}
<div class="row">
<div class="col-sm">
{% csrf_token %}
<div class="col-sm-6">
</div>
</div>
<div class="col-sm-6">
31
</div>
</div>
<div class="col-sm-6">
</div>
</div>
<div class="col-sm-2"></div>
</div>
</div>
</form>
</div>
</div>
{% endblock %}
confirm.html
{{product.name}}
{{product.price}}
32
{{product.image.url}}
{{customer.address}}
{{customer.pincode}}
{% if method == "add_to_cart" %}
{{item.product.name}}
{% endfor %}
{% else %}
{% csrf_token %}
</form>
{% endif %}
33
index.html
<!doctype html>
<html lang="en">
{% load static %}
<head>
<meta charset="utf-8">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css"
integrity="sha512-
1sCRPdkRXhBV2PBLUdRb4tMg1w2YPf37qatUFeS7zlBy7jJI8Lf4VHwWfZZfpXtYSL
y85pkm9GaYVYMfw5BC1A==" crossorigin="anonymous" referrerpolicy="no-
referrer" />
</head>
<body>
<div class="container-fluid">
34
<!-- outer start -->
{% include "navbar.html" %}
<div class="row">
<div class="carousel-indicators">
</div>
<div class="carousel-inner">
</div>
35
</div>
<div class="carousel-item">
</div>
</div>
<div class="carousel-item">
</div>
</div>
</div>
<span class="visually-hidden">Previous</span>
</button>
36
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
37
<div class="col-sm-3 text-center">
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<div class="mt-2">
</div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<div class="mt-2">
</div>
</div>
</div>
39
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<div class="mt-2">
</div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<div class="mt-2">
</div>
</div>
</div>
41
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<div class="mt-2">
</div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
42
<div class="mt-2">
</div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<div class="mt-2">
</div>
</div>
</div>
</div>
</div>
43
<!-- product end -->
{% include "footer.html" %}
</div>
</body>
</html>
login.html
{% extends "base.html" %}
{% block title %}
Login!
{% endblock %}
{% block content %}
<div class="col-sm-4">
<h2 class="text-center">Login!</h2>
{% if err %}
{{err}}
</div>
44
{% endif %}
{% if msg %}
{{msg}}
</div>
{% endif %}
{% csrf_token %}
<div class="col-sm-10">
</div>
</div>
<div class="col-sm-10">
</div>
</div>
<div class="form-check">
45
<input class="form-check-input" type="checkbox" value=""
id="rememberme">
Remember Me
</label>
</div>
<div class="text-center">
</div>
</form>
</div>
</div>
{% endblock %}
modal.html
<!doctype html>
<html lang="en">
{% load static %}
<head>
<meta charset="utf-8">
46
<link rel="stylesheet" href="{% static 'css/bootstrap.css' %}">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css"
integrity="sha512-
1sCRPdkRXhBV2PBLUdRb4tMg1w2YPf37qatUFeS7zlBy7jJI8Lf4VHwWfZZfpXtYSL
y85pkm9GaYVYMfw5BC1A==" crossorigin="anonymous" referrerpolicy="no-
referrer" />
</head>
<body>
<div class="container-fluid">
<ul class="smi">
47
<li><i class="fa-brands fa-facebook-f"></i></li>
</ul>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="container-fluid">
<span class="navbar-toggler-icon"></span>
</button>
<li class="nav-item">
48
</li>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
</li>
<li class="nav-item">
</li>
</ul>
</form>
</div>
</div>
49
</nav>
</div>
</div>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
50
<!-- navbar end -->
{% include 'footer.html' %}
</div>
</body>
</html>
mycart.html
{% extends "userbase.html" %}
{% block page_title %}
My Cart
{% endblock %}
{% block user %}
{% if request.GET.err %}
{{request.GET.err}}
</div>
{% endif %}
<div class="row">
<div class="col-sm-9">
<table class="table">
<thead>
<tr>
<th scope="col"></th>
51
<th scope="col">Product</th>
<th scope="col">Price</th>
<th scope="col">Quantity</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{cart_item.product.name}}</td>
<td>Rs. {{cart_item.product.price}}</td>
<td>
{% csrf_token %}
</form>
</td>
52
<td>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="row">
<div class="col-sm">
</div>
</div>
</div>
<h4>
</h4>
<div class="row">
</div>
</div>
</div>
{% endblock %}
navbar.html
{% load static %}
<ul class="smi">
</ul>
54
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="container-fluid">
<span class="navbar-toggler-icon"></span>
</button>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
55
<a class="nav-link" href="{% url 'product' %}">Products</a>
</li>
<li class="nav-item">
</li>
{% if user.is_authenticated %}
<li class="nav-item">
</li>
<li class="nav-item">
</li>
{% else %}
<li class="nav-item">
</li>
{% endif %}
</ul>
<div class="">
{% if user.is_authenticated %}
{% if request.session.cart > 0 %}
{{request.session.cart}}
{% endif %}
</span>
</button>
</form>
{% endif %}
</div>
</form>
</div>
</div>
</nav>
</div>
57
</div>
orders.html
{% extends "userbase.html" %}
{% block page_title %}
My Orders
{% endblock %}
{% block user %}
<div class="row">
<div class="col-sm">
<table class="table">
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Product</th>
<th scope="col">Price</th>
<th scope="col">Quantity</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
58
{% for order in orders %}
<tr>
<td>{{order.product.name}}</td>
<td>{{order.price}}</td>
<td>{{order.quantity}}</td>
<td>{{order.order_date}}</td>
{% else %}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}
products.html
{% extends "base.html" %}
{% block title %}
Products
59
{% endblock %}
{% block content %}
<!--
{% for x in products %}
{% endfor %}
-->
<!--
<p>{{ctg.name}}</p>
{% endfor %}
-->
{% if request.GET.msg %}
<div class="row">
<div class="col-sm">
</symbol>
</svg>
60
<div class="alert alert-success d-flex align-items-center" role="alert">
<div>
{{request.GET.msg}}
</div>
</div>
</div>
</div>
{% endif %}
<div class="col-sm-2">
<div class="list-group">
{% endfor %}
</div>
</div>
<div class="col-sm">
61
<div class="row">
<div class="card-body">
<h5 class="card-title">{{product.name}}</h5>
<p class="card-text">{{product.desc}}</p>
<div class="row">
<div class="col-sm">
<a href="/mycart?
product_id={{product.id}}&flag=add_to_cart&category={{request.GET.category}}"
class="btn btn-warning" value="">Add To Card</a>
</div>
<div class="col-sm">
{% csrf_token %}
</form></div>
</div>
62
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
{% endblock %}
register.html
{% extends "base.html" %}
{% block title %}
Sign Up!
{% endblock %}
{% block content %}
<div class="col-sm-4">
{% if err %}
</div>
{% endif %}
{% csrf_token %}
<div class="col-sm-10">
</div>
</div>
<div class="col-sm-10">
</div>
</div>
64
<label for="password" class="col-sm-2 col-form-label">Password</label>
<div class="col-sm-10">
</div>
</div>
<div class="col-sm-10">
</div>
</div>
<div class="col-sm-10">
</div>
</div>
<div class="col-sm-10">
65
<input name="phone" type="text" class="form-control"
value="{{values.phone}}" id="phone" required>
</div>
</div>
<div class="col-sm-10">
<div class="form-check">
Male
</label>
</div>
<div class="form-check">
Female
</label>
</div>
</div>
</fieldset>
66
<div class="text-center">
</div>
</form>
</div>
</div>
{% endblock %}
user.html
{% extends "userbase.html" %}
{% block page_title %}
My Account
{% endblock %}
{% block user %}
{% if msg %}
{{msg}}
</div>
{% endif %}
<div class="col-sm-6">
<tr>
</tr>
<tr>
<td class="fw-bold">Email</td><td>{{customer.emailaddress}}</td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
68
<td class="fw-bold">Password</td><td><a href="{% url 'changepass' %}"
class="btn btn-warning">Change Password</a></td>
</tr>
</tbody>
</table>
</div>
</div>
{% endblock %}
userbase.html
{% extends "base.html" %}
{% block title %}
Welcome User
{% endblock %}
{% block content %}
<h4 class="text-uppercase">
{% block page_title %}
{% endblock %}
</h4>
</div>
69
</div>
<div class="col-sm-2">
<div class="list-group">
</div>
</div>
<div class="col-sm">
{% block user %}
{% endblock %}
</div>
</div>
{% endblock %}
70
Conclusion & Future Scope
The system has been developed with much care and free of errors and at the same time it
is efficient and less time consuming. The purpose of this project was to develop a web
application and an android application for purchasing items from a shop. This project
helped us in gaining valuable information and practical knowledge on several topics like
designing web pages using html & CSS, usage of responsive templates, designing of Web
applications, and management of database using MySQL. The entire system is secured.
The project also helped us understanding about the development phases of a project and
software development life cycle. We learned how to test different features of a project.
This project has given us great satisfaction in having designed an application which can
be implemented to any nearby shops or branded shops selling various kinds of products
by simple modifications.
There is a scope for further development in our project to a great extent. A number of
features can be added to this system in future like providing moderator more control over
products so that each moderator can maintain their own products. Another feature we
wished to implement was providing classes for customers so that different offers can be
given to each class. System may keep track of history of purchases of each customer and
71
provide suggestions based on their history. These features could have implemented unless
the time did not limit us.
72