Professional Documents
Culture Documents
E-Commerce Project Report
E-Commerce Project Report
ON
E-commerce website
SUBMITTED FOR THE PARTIAL FULFILMENT FOR THE AWARD OF THE DEGREE
MASTER IN COMPUTER APPLICATIONS
(Batch:2022-2024)
Submitted By:
Abhishek Mandal
Regd. No -2205201001
ESTD.– 1997
DEPARTMENT OF MASTER IN COMPUTER APPLICATIONS
SEEMANTA ENGINEERING COLLEGE, MAYURVIHAR, MAYURBHANJ,
ODISHA
Major Project Report
ON
E-commerce website
SUBMITTED FOR THE PARTIAL FULFILMENT FOR THE AWARD OF THE DEGREE
MASTER IN COMPUTER APPLICATIONS
(Batch:2022-2024)
Submitted By:
Abhishek Mandal
ROLL No -2322MCA10
ESTD.– 1997
DEPARTMENT OF MASTER IN COMPUTER APPLICATIONS
SEEMANTA ENGINEERING COLLEGE, MAYURVIHAR, MAYURBHANJ,
ODISHA
EVALUATION OF PROJECT
E-commerce website
This is to certified that the project entitled " E-commerce website" submitted by
ABHISHEK MANDAL bearing Class Roll number : 2322MCA10, Examination
Regd number: 2205201001 of Seemanta Engineering College, Mayurbhanj,
Odisha is a bonafide work carried out by her under mysupervision and guidance to
the best ofmy knowledge the matter embodied in this report furnished are right for
this project and has not been submitted to any other university/institute for the
At the outset, I would like to take the opportunity to thank Prof. Rajib Kar for
inspiring me to do this project. The opportunity provided by her helped me to
grow as a software developer as well as an individual.
I am also grateful to Prof. Rajib Kar, Head of the Department for assigning me
this interesting project and for her valuable suggestion and encouragement at
various stage of work. I am also grateful to all the faculty of MCAfor their valuable
suggestions and inputs during the course of the project work.
An assemblage of this nature could never have been attempted without the
reference and inspiration from the works of others whose details are mentioned
inreference section. I acknowledged my indebtedness to all of them.
Last but clearly not the least, my sincere thanks to all my friends who have
patiently extended all sorts of help and my utmost thank to The Almighty for
giving me strength to complete my report on time.
Abhishek Mandal
Roll no: 2322MCA10
Regd no: 2205201001
ABSTRACT
Software Requirement
Hardware Configuration:
In the literature review section, we delve into existing research, studies, and
resources related to E-Commerce platforms, focusing on their features,
functionalities, and the technologies used for their development. This section
provides valuable insights into industry best practices, trends, and challenges, which
serve as a foundation for informing the design and development of our own E-
Commerce website.
Identify and analyze the key features and functionalities offered by these platforms,
such as product catalog management, user authentication, shopping cart
management, checkout process, order tracking, and customer support.
Discuss how these platforms differentiate themselves through unique features, such
as personalized recommendations, social sharing capabilities, subscription services,
and loyalty programs.
Blood request handling workflows for hospitals and healthcare facilities to place
orders for specific blood types.
Reporting and analytics tools to monitor blood utilization rates, identify trends, and
optimize inventory management strategies.
Overall, the literature review underscores the importance of BBMS in enhancing the
efficiency and effectiveness of blood bank operations. By leveraging Django's
capabilities, developers can create sophisticated BBMS solutions that address the
unique challenges faced by blood banks, ultimately improving patient outcomes and
saving lives
3.3 Discussion of Key Features and Functionalities Commonly Found
in E-Commerce platforms:
Product Management: Ability to add, edit, and delete products, manage categories
and attributes, and set pricing and inventory levels.
Shopping Cart and Checkout: Seamless shopping cart management, with features
like product quantity adjustments, shipping options, and secure checkout processes.
Search and Navigation: Powerful search functionality and intuitive navigation menus
to help users find products quickly and easily.
Customer Support: Support channels such as live chat, email, and phone support,
along with self-service options like FAQs and help documentation.
Analytics and Reporting: Insights into sales performance, customer behavior, and
marketing effectiveness through analytics dashboards and reporting tools.
These features contribute to a seamless and engaging shopping experience for users
while providing businesses with the tools they need to manage their online
operations effectively.
In conclusion, the literature review provides valuable insights into the landscape of E-
Commerce platforms, the capabilities of Django and similar frameworks for E-
Commerce development, and the key features and functionalities that define
successful E-Commerce websites. This knowledge will inform the design and
development of our own E-Commerce platform, ensuring that it meets the needs of
both businesses and consumers in the competitive online marketplace.
Requirements Analysis:
Registered users should be able to log in securely to access their accounts and
perform actions such as browsing products, adding items to cart, and making
purchases.
Product Management:
Admin users should be able to add, edit, and delete products, including details
such as name, description, price, and inventory.
Products should be organized into categories and subcategories for easy
navigation and searchability.
Users should be able to add items to their shopping cart, view cart contents,
and update quantities or remove items as needed.
A streamlined checkout process should guide users through payment and
order confirmation, collecting necessary information such as shipping address
and payment method.
Order Management:
Admin users should have access to an order management interface where they
can view and process orders, update order statuses, and communicate with
customers regarding order fulfillment and shipping.
Non-functional requirements specify the qualities or attributes that the system must
possess, such as performance, reliability, security, and usability. These requirements
describe how the system should behave.
Performance:
The website should be responsive and load quickly, even under heavy traffic
loads.
Database queries and transactions should be optimized for efficiency to
minimize response times.
Security:
Scalability:
Usability:
The website should have a clean and intuitive user interface, with clear
navigation and visual cues to guide users through the shopping process.
Accessibility features should be implemented to ensure that the website is
usable by people with disabilities.
4.3 Use Cases and User Stories:
Use cases and user stories provide detailed descriptions of how users interact with
the system and the specific actions they perform. These scenarios help to clarify the
requirements and define the user experience.
User Story: As an admin user, I want to be able to view a list of pending orders and
process them efficiently by updating order statuses and communicating with
customers as needed.
Design:
The system architecture of the Blood Bank Management System (BBMS) outlines the
high-level structure and components of the software application. It defines how the
various modules and subsystems interact with each other to achieve the system's
objectives. Here's an overview of the system architecture:
Server-Side Logic: The server-side logic consists of the application servers where the
business logic and processing occur. This includes functionalities such as donor
registration, blood inventory management, blood request handling, and reporting.
Database Management System (DBMS): The DBMS stores and manages the system's
data, including donor records, blood inventory, testing results, and transaction
history. It ensures data integrity, reliability, and accessibility for authorized users.
Integration with External Systems: The BBMS may integrate with external systems
such as laboratory information systems (LIS), electronic health record (EHR) systems,
and payment gateways. These integrations enable seamless data exchange and
interoperability with other healthcare IT systems.
Frontend and Backend Separation: The frontend is responsible for presenting the
user interface and handling user interactions, while the backend manages data
storage, business logic, and communication with external services.
Scalability Considerations: The architecture should be designed to scale horizontally
and vertically to accommodate growing user traffic and data volumes. This may
involve load balancing, caching, and distributed database architectures.
Use Case Diagram: Illustrates the various use cases or functionalities of the system,
along with the actors (users or external systems) interacting with them. This helps in
identifying system requirements and defining user interactions.
Class Diagram: Represents the system's class structure, including classes, attributes,
methods, and relationships between them. This diagram helps in understanding the
data model and designing the system's object-oriented architecture.
Planning:
Design:
Design the database schema using Django's ORM, defining models to represent
data entities and their relationships.
Design the user interface (UI) using HTML, CSS, and JavaScript frameworks,
ensuring responsiveness and accessibility.
Plan the architecture of the application, including views, URLs, and templates.
Implementation:
Develop the backend logic using Django, including views, models, forms, and URL
routing.
Implement frontend components using HTML templates and integrate them with
Django's templating engine.
Configure settings such as database connections, static files, and middleware.
Write tests to verify the functionality and integrity of the application.
Testing:
Conduct unit tests, integration tests, and end-to-end tests to identify and fix bugs
and ensure the application meets requirements.
Perform user acceptance testing (UAT) to gather feedback from stakeholders and
validate the usability and functionality of the application.
Deployment:
Frontend Integration:
Database Management:
Frontend Integration:
Database Management:
class Product(models.Model):
name = models.CharField(max_length=100)
description = models.TextField()
price = models.DecimalField(max_digits=10, decimal_places=2)
inventory = models.PositiveIntegerField(default=0)
class Order(models.Model):
user = models.ForeignKey('auth.User', on_delete=models.CASCADE)
products = models.ManyToManyField(Product, through='OrderItem')
total_price = models.DecimalField(max_digits=10, decimal_places=2)
created_at = models.DateTimeField(auto_now_add=True)
class OrderItem(models.Model):
order = models.ForeignKey(Order, on_delete=models.CASCADE)
product = models.ForeignKey(Product, on_delete=models.CASCADE)
quantity = models.PositiveIntegerField()
unit_price = models.DecimalField(max_digits=10, decimal_places=2)
@login_required
def product_detail(request, product_id):
product = Product.objects.get(id=product_id)
return render(request, 'product_detail.html', {'product': product})
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ product.name }}</title>
</head>
<body>
<h1>{{ product.name }}</h1>
<p>{{ product.description }}</p>
<p>Price: ${{ product.price }}</p>
<!-- Additional HTML content for product details -->
</body>
</html>
User Authentication (views.py):
def home_view(request):
products=models.Product.objects.all()
if 'product_ids' in request.COOKIES:
product_ids = request.COOKIES['product_ids']
counter=product_ids.split('|')
product_count_in_cart=len(set(counter))
else:
product_count_in_cart=0
if request.user.is_authenticated:
return HttpResponseRedirect('afterlogin')
return
render(request,'ecom/index.html',{'products':products,'product_count_in_cart':product_count_in_car
t})
def customer_signup_view(request):
userForm=forms.CustomerUserForm()
customerForm=forms.CustomerForm()
mydict={'userForm':userForm,'customerForm':customerForm}
if request.method=='POST':
userForm=forms.CustomerUserForm(request.POST)
customerForm=forms.CustomerForm(request.POST,request.FILES)
if userForm.is_valid() and customerForm.is_valid():
user=userForm.save()
user.set_password(user.password)
user.save()
customer=customerForm.save(commit=False)
customer.user=user
customer.save()
my_customer_group = Group.objects.get_or_create(name='CUSTOMER')
my_customer_group[0].user_set.add(user)
return HttpResponseRedirect('customerlogin')
return render(request,'ecom/customersignup.html',context=mydict)
#---------------------------------------------------------------------------------
#------------------------ ADMIN RELATED VIEWS START ------------------------------
#---------------------------------------------------------------------------------
@login_required(login_url='adminlogin')
def admin_dashboard_view(request):
# for cards on dashboard
customercount=models.Customer.objects.all().count()
productcount=models.Product.objects.all().count()
ordercount=models.Orders.objects.all().count()
mydict={
'customercount':customercount,
'productcount':productcount,
'ordercount':ordercount,
'data':zip(ordered_products,ordered_bys,orders),
}
return render(request,'ecom/admin_dashboard.html',context=mydict)
@login_required(login_url='adminlogin')
def update_customer_view(request,pk):
customer=models.Customer.objects.get(id=pk)
user=models.User.objects.get(id=customer.user_id)
userForm=forms.CustomerUserForm(instance=user)
customerForm=forms.CustomerForm(request.FILES,instance=customer)
mydict={'userForm':userForm,'customerForm':customerForm}
if request.method=='POST':
userForm=forms.CustomerUserForm(request.POST,instance=user)
customerForm=forms.CustomerForm(request.POST,instance=customer)
if userForm.is_valid() and customerForm.is_valid():
user=userForm.save()
user.set_password(user.password)
user.save()
customerForm.save()
return redirect('view-customer')
return render(request,'ecom/admin_update_customer.html',context=mydict)
@login_required(login_url='adminlogin')
def delete_product_view(request,pk):
product=models.Product.objects.get(id=pk)
product.delete()
return redirect('admin-products')
@login_required(login_url='adminlogin')
def update_product_view(request,pk):
product=models.Product.objects.get(id=pk)
productForm=forms.ProductForm(instance=product)
if request.method=='POST':
productForm=forms.ProductForm(request.POST,request.FILES,instance=product)
if productForm.is_valid():
productForm.save()
return redirect('admin-products')
return render(request,'ecom/admin_update_product.html',{'productForm':productForm})
@login_required(login_url='adminlogin')
def admin_view_booking_view(request):
orders=models.Orders.objects.all()
ordered_products=[]
ordered_bys=[]
for order in orders:
ordered_product=models.Product.objects.all().filter(id=order.product.id)
ordered_by=models.Customer.objects.all().filter(id = order.customer.id)
ordered_products.append(ordered_product)
ordered_bys.append(ordered_by)
return
render(request,'ecom/admin_view_booking.html',{'data':zip(ordered_products,ordered_bys,orders)})
@login_required(login_url='adminlogin')
def delete_order_view(request,pk):
order=models.Orders.objects.get(id=pk)
order.delete()
return redirect('admin-view-booking')
#---------------------------------------------------------------------------------
#------------------------ PUBLIC CUSTOMER RELATED VIEWS START ---------------------
#---------------------------------------------------------------------------------
def search_view(request):
# whatever user write in search box we get in query
query = request.GET['query']
products=models.Product.objects.all().filter(name__icontains=query)
if 'product_ids' in request.COOKIES:
product_ids = request.COOKIES['product_ids']
counter=product_ids.split('|')
product_count_in_cart=len(set(counter))
else:
product_count_in_cart=0
# word variable will be shown in html when user click on search button
word="Searched Result :"
if request.user.is_authenticated:
return
render(request,'ecom/customer_home.html',{'products':products,'word':word,'product_count_in_cart':
product_count_in_cart})
return
render(request,'ecom/index.html',{'products':products,'word':word,'product_count_in_cart':product_
count_in_cart})
#for cart counter, fetching products ids added by customer from cookies
if 'product_ids' in request.COOKIES:
product_ids = request.COOKIES['product_ids']
counter=product_ids.split('|')
product_count_in_cart=len(set(counter))
else:
product_count_in_cart=1
response = render(request,
'ecom/index.html',{'products':products,'product_count_in_cart':product_count_in_cart})
product=models.Product.objects.get(id=pk)
messages.info(request, product.name + ' added to cart successfully!')
return response
def remove_from_cart_view(request,pk):
#for counter in cart
if 'product_ids' in request.COOKIES:
product_ids = request.COOKIES['product_ids']
counter=product_ids.split('|')
product_count_in_cart=len(set(counter))
else:
product_count_in_cart=0
def send_feedback_view(request):
feedbackForm=forms.FeedbackForm()
if request.method == 'POST':
feedbackForm = forms.FeedbackForm(request.POST)
if feedbackForm.is_valid():
feedbackForm.save()
return render(request, 'ecom/feedback_sent.html')
return render(request, 'ecom/send_feedback.html', {'feedbackForm':feedbackForm})
#---------------------------------------------------------------------------------
#------------------------ CUSTOMER RELATED VIEWS START ------------------------------
#---------------------------------------------------------------------------------
@login_required(login_url='customerlogin')
@user_passes_test(is_customer)
def customer_home_view(request):
products=models.Product.objects.all()
if 'product_ids' in request.COOKIES:
product_ids = request.COOKIES['product_ids']
counter=product_ids.split('|')
product_count_in_cart=len(set(counter))
else:
product_count_in_cart=0
return
render(request,'ecom/customer_home.html',{'products':products,'product_count_in_cart':product_coun
t_in_cart})
addressForm = forms.AddressForm()
if request.method == 'POST':
addressForm = forms.AddressForm(request.POST)
if addressForm.is_valid():
# here we are taking address, email, mobile at time of order placement
# we are not taking it from customer account table because
# these thing can be changes
email = addressForm.cleaned_data['Email']
mobile=addressForm.cleaned_data['Mobile']
address = addressForm.cleaned_data['Address']
#for showing total price on payment page.....accessing id from cookies then fetching
price of product from db
total=0
if 'product_ids' in request.COOKIES:
product_ids = request.COOKIES['product_ids']
if product_ids != "":
product_id_in_cart=product_ids.split('|')
products=models.Product.objects.all().filter(id__in = product_id_in_cart)
for p in products:
total=total+p.price
# here we are just directing to this view...actually we have to check whther payment is successful
or not
#then only this view should be accessed
@login_required(login_url='customerlogin')
def payment_success_view(request):
# Here we will place order | after successful payment
# we will fetch customer mobile, address, Email
# we will fetch product id from cookies then respective details from db
# then we will create order objects and store in db
# after that we will delete cookies because after order placed...cart should be empty
customer=models.Customer.objects.get(user_id=request.user.id)
products=None
email=None
mobile=None
address=None
if 'product_ids' in request.COOKIES:
product_ids = request.COOKIES['product_ids']
if product_ids != "":
product_id_in_cart=product_ids.split('|')
products=models.Product.objects.all().filter(id__in = product_id_in_cart)
# Here we get products list that will be ordered by one customer at a time
models.Orders.objects.get_or_create(customer=customer,product=product,status='Pending',email=email
,mobile=mobile,address=address)
@login_required(login_url='customerlogin')
@user_passes_test(is_customer)
def my_order_view(request):
customer=models.Customer.objects.get(user_id=request.user.id)
orders=models.Orders.objects.all().filter(customer_id = customer)
ordered_products=[]
for order in orders:
ordered_product=models.Product.objects.all().filter(id=order.product.id)
ordered_products.append(ordered_product)
return render(request,'ecom/my_order.html',{'data':zip(ordered_products,orders)})
@login_required(login_url='customerlogin')
@user_passes_test(is_customer)
def download_invoice_view(request,orderID,productID):
order=models.Orders.objects.get(id=orderID)
product=models.Product.objects.get(id=productID)
mydict={
'orderDate':order.order_date,
'customerName':request.user,
'customerEmail':order.email,
'customerMobile':order.mobile,
'shipmentAddress':order.address,
'orderStatus':order.status,
'productName':product.name,
'productImage':product.product_image,
'productPrice':product.price,
'productDescription':product.description,
}
return render_to_pdf('ecom/download_invoice.html',mydict)
@login_required(login_url='customerlogin')
@user_passes_test(is_customer)
def my_profile_view(request):
customer=models.Customer.objects.get(user_id=request.user.id)
return render(request,'ecom/my_profile.html',{'customer':customer})
@login_required(login_url='customerlogin')
@user_passes_test(is_customer)
def edit_profile_view(request):
customer=models.Customer.objects.get(user_id=request.user.id)
user=models.User.objects.get(id=customer.user_id)
userForm=forms.CustomerUserForm(instance=user)
customerForm=forms.CustomerForm(request.FILES,instance=customer)
mydict={'userForm':userForm,'customerForm':customerForm}
if request.method=='POST':
userForm=forms.CustomerUserForm(request.POST,instance=user)
customerForm=forms.CustomerForm(request.POST,instance=customer)
if userForm.is_valid() and customerForm.is_valid():
user=userForm.save()
user.set_password(user.password)
user.save()
customerForm.save()
return HttpResponseRedirect('my-profile')
return render(request,'ecom/edit_profile.html',context=mydict)
#---------------------------------------------------------------------------------
#------------------------ ABOUT US AND CONTACT US VIEWS START --------------------
#---------------------------------------------------------------------------------
def aboutus_view(request):
return render(request,'ecom/aboutus.html')
def contactus_view(request):
sub = forms.ContactusForm()
if request.method == 'POST':
sub = forms.ContactusForm(request.POST)
if sub.is_valid():
email = sub.cleaned_data['Email']
name=sub.cleaned_data['Name']
message = sub.cleaned_data['Message']
send_mail(str(name)+' || '+str(email),message, settings.EMAIL_HOST_USER,
settings.EMAIL_RECEIVING_USER, fail_silently = False)
return render(request, 'ecom/contactussuccess.html')
return render(request, 'ecom/contactus.html', {'form':sub}
models.py
"""
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Customer(models.Model):
user=models.OneToOneField(User,on_delete=models.CASCADE)
profile_pic=
models.ImageField(upload_to='profile_pic/CustomerProfilePic/',null=True,blank=True)
address = models.CharField(max_length=40)
mobile = models.CharField(max_length=20,null=False)
@property
def get_name(self):
return self.user.first_name+" "+self.user.last_name
@property
def get_id(self):
return self.user.id
def __str__(self):
return self.user.first_name
class Product(models.Model):
name=models.CharField(max_length=40)
product_image= models.ImageField(upload_to='product_image/',null=True,blank=True)
price = models.PositiveIntegerField()
description=models.CharField(max_length=40)
def __str__(self):
return self.name
class Orders(models.Model):
STATUS =(
('Pending','Pending'),
('Order Confirmed','Order Confirmed'),
('Out for Delivery','Out for Delivery'),
('Delivered','Delivered'),
)
customer=models.ForeignKey('Customer', on_delete=models.CASCADE,null=True)
product=models.ForeignKey('Product',on_delete=models.CASCADE,null=True)
email = models.CharField(max_length=50,null=True)
address = models.CharField(max_length=500,null=True)
mobile = models.CharField(max_length=20,null=True)
order_date= models.DateField(auto_now_add=True,null=True)
status=models.CharField(max_length=50,null=True,choices=STATUS)
class Feedback(models.Model):
name=models.CharField(max_length=40)
feedback=models.CharField(max_length=500)
date= models.DateField(auto_now_add=True,null=True)
def __str__(self):
return self.name
forms.py
class ProductAdmin(admin.ModelAdmin):
pass
admin.site.register(Product, ProductAdmin)
class OrderAdmin(admin.ModelAdmin):
pass
admin.site.register(Orders, OrderAdmin)
class FeedbackAdmin(admin.ModelAdmin):
pass
admin.site.register(Feedback, FeedbackAdmin)
# Register your models here.
Settings.py:
"""
Django settings for ecommerce project.
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'ecom',
'widget_tweaks',
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
ROOT_URLCONF = 'ecommerce.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [TEMPLATE_DIR,],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'ecommerce.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
STATIC_URL = '/static/'
STATICFILES_DIRS=[STATIC_DIR,]
MEDIA_ROOT=os.path.join(BASE_DIR,'static')
LOGIN_REDIRECT_URL='/afterlogin'
url.py:
"""
Developed By : sumit kumar
facebook : fb.com/sumit.luv
Youtube :youtube.com/lazycoders
"""
from django.contrib import admin
from django.urls import path
from ecom import views
from django.contrib.auth.views import LoginView,LogoutView
urlpatterns = [
path('admin/', admin.site.urls),
path('',views.home_view,name=''),
path('afterlogin', views.afterlogin_view,name='afterlogin'),
path('logout', LogoutView.as_view(template_name='ecom/logout.html'),name='logout'),
path('aboutus', views.aboutus_view),
path('contactus', views.contactus_view,name='contactus'),
path('search', views.search_view,name='search'),
path('send-feedback', views.send_feedback_view,name='send-feedback'),
path('view-feedback', views.view_feedback_view,name='view-feedback'),
path('adminclick', views.adminclick_view),
path('adminlogin', LoginView.as_view(template_name='ecom/adminlogin.html'),name='adminlogin'),
path('admin-dashboard', views.admin_dashboard_view,name='admin-dashboard'),
path('view-customer', views.view_customer_view,name='view-customer'),
path('delete-customer/<int:pk>', views.delete_customer_view,name='delete-customer'),
path('update-customer/<int:pk>', views.update_customer_view,name='update-customer'),
path('admin-products', views.admin_products_view,name='admin-products'),
path('admin-add-product', views.admin_add_product_view,name='admin-add-product'),
path('delete-product/<int:pk>', views.delete_product_view,name='delete-product'),
path('update-product/<int:pk>', views.update_product_view,name='update-product'),
path('admin-view-booking', views.admin_view_booking_view,name='admin-view-booking'),
path('delete-order/<int:pk>', views.delete_order_view,name='delete-order'),
path('update-order/<int:pk>', views.update_order_view,name='update-order'),
path('customersignup', views.customer_signup_view),
path('customerlogin',
LoginView.as_view(template_name='ecom/customerlogin.html'),name='customerlogin'),
path('customer-home', views.customer_home_view,name='customer-home'),
path('my-order', views.my_order_view,name='my-order'),
path('my-profile', views.my_profile_view,name='my-profile'),
path('edit-profile', views.edit_profile_view,name='edit-profile'),
path('download-invoice/<int:orderID>/<int:productID>',
views.download_invoice_view,name='download-invoice'),
path('add-to-cart/<int:pk>', views.add_to_cart_view,name='add-to-cart'),
path('cart', views.cart_view,name='cart'),
path('remove-from-cart/<int:pk>', views.remove_from_cart_view,name='remove-from-cart'),
path('customer-address', views.customer_address_view,name='customer-address'),
path('payment-success', views.payment_success_view,name='payment-success'),
]
Aboutus.html:
<!DOCTYPE html>
{% load static %}
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>SS_coding || Sandip</title>
<title>sumit</title>
<style media="screen">
.footer{
position: fixed;
}
</style>
</head>
<head>
<style media="screen">
a:link {
text-decoration: none;
}
.note {
text-align: center;
height: 80px;
background: -webkit-linear-gradient(left, #0072ff, #8811c5);
color: #fff;
font-weight: bold;
line-height: 80px;
}
.form-content {
padding: 5%;
border: 1px solid #ced4da;
margin-bottom: 2%;
}
.form-control {
border-radius: 1.5rem;
}
.btnSubmit {
border: none;
border-radius: 1.5rem;
padding: 1%;
width: 20%;
cursor: pointer;
background: #0062cc;
color: #fff;
}
.menu {
top: 50px;
}
</style>
</div>
<div class="col-md-6">
<div class="form-group">
{% render_field productForm.price class="form-control" placeholder="Price" %}
</div>
<div class="form-group">
{% render_field productForm.product_image class="form-control"
placeholder="product_image" %}
</div>
</div>
</div>
<button type="submit" class="btnSubmit">ADD</button>
</div>
</div>
</div>
</form>
<!--
developed By : sandip kumar
-->
{% endblock content %}
Adminbase.html:
<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-
awesome.min.css">
<style type="text/css">
.bs-example {
margin: 0px;
}
.navbar-brand {
font-size: 20px;
font-family: sans-serif;
/*---------------------------------------
Social section
-----------------------------------------*/
footer {
padding: 0px 0px 0px 0px;
background-color: black;
margin: 0px;
}
#ftr {
padding: 20px;
}
.fa {
font-size: 23px;
width: 60px;
text-align: center;
text-decoration: none;
margin: 5px 2px;
border-radius: 50%;
}
.fa:hover {
opacity: 0.5;
text-decoration: none;
}
.fa-facebook {
background: #3B5998;
color: white;
margin-top: 30px;
}
.fa-whatsapp {
background: #25d366;
color: white;
}
.fa-twitter {
background: #55ACEE;
color: white;
}
.fa-instagram {
background: #125688;
color: white;
}
p {
text-align: center;
}
</style>
</head>
<body>
<div class="bs-example">
<nav class="navbar navbar-expand-md navbar-dark fixed-top" style="background:#337AB7;">
<a href="/" class="navbar-brand">Ecommerce</a>
<button type="button" class="navbar-toggler" data-toggle="collapse" data-
target="#navbarCollapse">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</nav>
</div>
{% endblock content %}
<!-- content end-->
<br><br><br><br><br><br><br><br>
<footer>
<p>
<a id="ftr" href="https://facebook.com/sumit.luv/" class="fa fa-facebook"></a>
<a id="ftr"
href="https://api.whatsapp.com/send?phone=919572181024&text=Hello%20Sumit.%0d%0aHow%20are%20you%20
%3f%0d%0aI%20came%20from%20your%20website.&source=&data=#" class="fa fa-whatsapp"></a>
<a id="ftr" href="https://instagram.com/sumit.luv" class="fa fa-instagram"></a>
<a id="ftr" href="https://twitter.com/sumitkumar1503" class="fa fa-twitter"></a>
</p>
<br>
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12">
<div style="color:#ffffff;" class="wow fadeInUp footer-copyright">
<p>Made in India <br>
Copyright © 2020 LazyCoder </p>
</div>
</div>
</div>
</div>
</footer>
<!--
developed By : sandip kumar
facebook : fb.com/sumit.luv
youtube : youtube.com/lazycoders
-->
</body>
</html>
customerlogin:
<!DOCTYPE html>
{% load widget_tweaks %}
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<style media="screen">
body {
margin: 0;
padding: 0;
font-family: sans-serif;
background: linear-gradient(to right, #b92b27, #1565c0)
}
.box {
width: 500px;
padding: 40px;
position: absolute;
top: 50%;
left: 50%;
background: #191919;
text-align: center;
transition: 0.25s;
margin-top: 100px
}
.box input[type="text"],
.box input[type="password"] {
border: 0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #3498db;
padding: 10px 10px;
width: 250px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s
}
.box h1 {
color: white;
text-transform: uppercase;
font-weight: 500
}
.box input[type="text"]:focus,
.box input[type="password"]:focus {
width: 300px;
border-color: #2ecc71
}
.box input[type="submit"] {
border: 0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #2ecc71;
padding: 14px 40px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
cursor: pointer
}
.box input[type="submit"]:hover {
background: #2ecc71
}
</style>
</head>
<body>
{% include "vehicle/navbar.html" %}
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="card">
<form class="box" method="post">
{% csrf_token %}
<h1>Customer Login</h1>
<p class="text-muted"> Please enter your login and password!</p>
</form>
</div>
</div>
</div>
</div>
<br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br>
<br><br><br><br><br>
{% include "vehicle/footer.html" %}
</body>
</html>
DonorlogIn:
<!DOCTYPE html>
{% load widget_tweaks %}
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<style media="screen">
body {
margin: 0;
padding: 0;
font-family: sans-serif;
background: linear-gradient(to right, #b92b27, #1565c0)
}
.box {
width: 500px;
padding: 40px;
position: absolute;
top: 50%;
left: 50%;
background: #191919;
text-align: center;
transition: 0.25s;
margin-top: 100px
}
.box input[type="text"],
.box input[type="password"] {
border: 0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #3498db;
padding: 10px 10px;
width: 250px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s
}
.box h1 {
color: white;
text-transform: uppercase;
font-weight: 500
}
.box input[type="text"]:focus,
.box input[type="password"]:focus {
width: 300px;
border-color: #2ecc71
}
.box input[type="submit"] {
border: 0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #2ecc71;
padding: 14px 40px;
outline: none;
color: white;
border-radius: 24px;
transition: 0.25s;
cursor: pointer
}
.box input[type="submit"]:hover {
background: #2ecc71
}
</style>
</head>
<body>
{% include "vehicle/navbar.html" %}
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="card">
<form class="box" method="post">
{% csrf_token %}
<h1>Mechanic Login</h1>
<p class="text-muted"> Please enter your login and password!</p>
</form>
</div>
</div>
</div>
</div>
<br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br>
<br><br><br><br><br>
{% include "vehicle/footer.html" %}
</body>
</html>
Index.html:
<!DOCTYPE html>
{% load static %}
<html lang="en" dir="ltr">
<style>
.jumbotron{
margin-bottom: 0px;
}
</style>
<body>
{% include "quiz/navbar.html" %}
<br>
<section id="section-jumbotron" class="jumbotron jumbotron-fluid d-flex justify-content-center
align-items-center">
<div class="container text-center">
<h1 class="display-1 text-info">Let's Quiz</h1>
<p class="display-4 d-none d-sm-block">Test your skills and become a master.</p>
<p class="lead">We organize quizzes on various topics.</p>
<p class="lead">Sign up if you haven't already and get access to millions of quizzes on the
topic of your interest.</p>
<p><strong> Start Your Journey Here:</strong></p>
<a href="/student/studentsignup" class="btn btn-lg btn-info" style="padding-right: 35px;"><i
class="fa fa-user-plus" aria-hidden="true"></i> Sign Up</a>
<br><br><br>
</div>
</section>
{% include "quiz/footer.html" %}
</body>
</html>
Testing:
7.1. Description of Testing Methodologies Employed:
7.1. Description of Testing Methodologies Employed:
Unit Testing:
Python's built-in unittest or third-party libraries like pytest are commonly used for
writing and executing unit tests.
Unit tests cover functions, methods, and classes, checking for correctness of logic,
input validation, and edge cases.
Integration Testing:
Integration testing verifies that different components of the system work together
seamlessly.
In Django, integration tests may involve testing views with mock requests, testing
database interactions, and testing middleware functionality.
Integration tests ensure that the frontend and backend components communicate
correctly and that data flows smoothly through the system.
UAT involves testing the E-Commerce website with real users or stakeholders to
validate its usability, functionality, and alignment with business requirements.
Test scenarios are created based on user stories and use cases, and users provide
feedback on their experience with the website.
UAT helps identify any usability issues, navigation problems, or missing features that
may impact user satisfaction.
Regression Testing:
Regression testing ensures that new code changes do not introduce unintended side
effects or break existing functionality.
Automated test suites are run on a regular basis to validate that previously tested
features still work as expected after code changes.
Regression tests cover critical paths and edge cases to catch regressions early in the
development process.
Security Testing:
Techniques such as penetration testing, vulnerability scanning, and code review are
used to assess the website's security posture.
Security testing helps protect sensitive user data, prevent unauthorized access, and
ensure compliance with security standards and regulations.
Description: Verify that users can register for an account with valid information.
Steps: Navigate to the registration page, enter valid user details, submit the
registration form.
Description: Verify that users can add products to their shopping cart.
Steps: Navigate to the product detail page, click on the "Add to Cart" button.
Expected Result: Product is added to the cart, and cart total is updated.
Result: Test passed.
Description: Verify that users can complete the checkout process successfully.
Steps: Navigate to the shopping cart, proceed to checkout, enter shipping and
payment information, confirm order.
Description: Verify that only authenticated users can access protected pages.
The deployment environment refers to the infrastructure where the online quiz
application is deployed and made accessible to users. Here's an overview:
Domain Name and SSL Certificate: Obtain a domain name for the application and
configure DNS settings to point to the server's IP address. Install an SSL certificate to
enable HTTPS encryption and ensure secure communication between clients and the
server.
The deployment process involves transferring the application from the development
environment to the production environment. Here's a step-by-step guide to the
deployment process:
To deploy a Django project using the `runserver` command for development
purposes, you can follow these steps:
Ensure Dependencies are Installed:
Make sure you have Python and Django installed on your system. You can install
Django using pip:
3. Run Migrations:
Before starting the development server, it's a good practice to apply any database
migrations:
```
python manage.py makemigrations
```
```
python manage.py runserver
```
This command will start the server, and you'll see output similar to:
```
Performing system checks...
```
Development Workflow:
Make any necessary changes to your project's code. The development server
automatically detects changes and reloads the server, allowing you to see your
updates in real-time.
```
Follow the prompts to create a superuser account, and then log in to the admin
interface to manage your project's data.
Deployment Considerations:
Remember that the `runserver` command is intended for development use only
and is not suitable for production deployment. For production deployment, you'll
need to use a production-grade server such as Gunicorn or uWSGI and configure it to
serve your Django application.
By following these steps, you can deploy your Django project using the `runserver`
command for development purposes and access it in a web browser on your local
machine.
Visual Representations:
Index Module
Homepage
Admin LogIn
Admin Module
Customer Module
Customer
Customer LogIn
Project Summary:
The project began with requirements gathering, where stakeholder needs and
expectations were identified and translated into design specifications. The
development team then proceeded to implement the design specifications, focusing on
building both the frontend and backend components of the website.
Backend development using Django, which involved defining models, views, and
URL routing to handle user requests, process data, and generate responses.
Frontend integration, where HTML templates were created and integrated with
Django's templating engine to render dynamic user interfaces.
Authentication and authorization mechanisms were implemented to secure user
data and restrict access to certain views or resources.
Database management, including designing the database schema, defining models,
and optimizing database queries for performance.
Testing methodologies employed included unit testing, integration testing, user
acceptance testing (UAT), regression testing, and security testing. Test cases were
designed to validate the functionality, usability, and security of the website,
ensuring a high-quality end product.
With the successful completion of the project, the E-Commerce website is ready for
deployment to production environments, where it will serve as a valuable asset for
businesses looking to establish or expand their online presence.
Conclusion:
The project has successfully addressed the diverse needs and requirements of
stakeholders, providing a user-friendly interface for customers to browse products,
make purchases, and manage their accounts, while also offering powerful backend
functionality for administrators to manage products, orders, and user accounts
efficiently.
Key highlights of the project include the utilization of Django's powerful features and
conventions to streamline development, the implementation of security measures to
protect user data and ensure safe transactions, and the incorporation of testing
methodologies to verify the functionality, usability, and security of the website.
Looking ahead, the E-Commerce website stands poised to make a significant impact
in the online retail space, offering businesses a powerful tool to reach customers,
drive sales, and grow their brand presence. With ongoing support and maintenance,
the website will continue to evolve and adapt to meet the changing needs and
expectations of users and stakeholders.