Final Project BBB
Final Project BBB
“ECOMMERCE WEBSITE”
Submitted in partial fulfillment of
The requirements for the 4th Semester Sessional
Examination of
BACHELOR OF TECHNOLOGY
IN
RAJDEEP PUROHIT-22UG010300
SAMEER KU PANDA-22UG010595
SANGRAM PANIGRAHY-22UG010432
GIET UNIVERSITY,GUNUPUR
Dist. - Rayagada, Odisha-765022,Contact:- +91
7735745535, 06857-250170,172,Visit us:-www.giet.edu
CERTIFICATE
Proctors ClassTeacher
We express our sincere gratitude to Mr. Radhanath Patra of Computer science and engineering
for giving us an opportunity to accomplish the project. Without her active support and guidance,
this project report has not been successfully completed.
We also thank our class teacher Mr. Sucheta Krupalini Moharana for her constant support and
guidance provided during this project period.
We also thank Dr. Bhavani Sankar Panda, Project Coordinator, Dr Sachikanta Dash, Head of the
Department of Computer Science and Engineering, Prof. (Dr.) Sanjay Kumar Kuanar, Dy. Dean,
Computational Science, SOET for their consistent support, guidance and help.
Rajdeep purohit-22UG010300
Sangram panigrahy-22UG010559
Sameer ku panda-22UG010432
3
DECLARATION
Rajdeep purohit-22UG010300
Sangram panigrahy-22UG010559
Sameer ku panda-22UG010432
4
ABSTRACT
1.1 Introduction
2. REQUIREMENTS SPECIFICATION
2.1 Introduction
3. MARKET ANALYSIS
3.2 Competitors
4. DESIGN
5. SYSTEM IMPLEMENTATION
5.1 Introduction
6. TESTING
6
6.1 Introduction
7. SAMPLE SCREENSHOTS
8. CONCLUSION
CHAPTER 1
INTRODUCTION
1.1 Introduction:
.In an era dominated by digital innovation and rapid technological advancement, the
landscape of commerce has undergone a profound transformation. The rise of e-commerce
has fundamentally altered the way businesses operate and consumers shop, ushering in an
era of unparalleled convenience, accessibility, and opportunity. As the boundaries of
traditional brick-and-mortar stores blur in the wake of online marketplaces, the need for
dynamic, user-centric e-commerce platforms has never been more pronounced.
As we embark on this journey, our vision is clear: to leverage the latest advancements in
technology, design, and user experience to craft a dynamic and immersive online shopping
destination. Through meticulous research, strategic planning, and collaborative iteration,
we seek to transcend the conventional boundaries of e-commerce, setting new standards of
excellence and paving the way for unprecedented growth and success.
7
This introduction sets the stage for an ambitious exploration into the complexities of e-
commerce website development, highlighting the transformative potential of our project
and underscoring its significance in shaping the future of online commerce. With
innovation as our guiding principle and user satisfaction as our ultimate goal, we are poised
to embark on a journey of discovery, creativity, and achievement in the dynamic world of
e-commerce..
Accessibility Issues:
Not all e-commerce websites are designed to accommodate users with disabilities, thereby
excluding a significant portion of the population from accessing goods and services online.
Inadequate support for different devices and internet connections further exacerbates
accessibility challenges, alienating potential customers and limiting market reach.
Global events, such as pandemics, natural disasters, and geopolitical tensions, can disrupt
supply chains, leading to inventory shortages, shipping delays, and price fluctuations.These
disruptions undermine the reliability and predictability of e-commerce operations,
impacting customer satisfaction and brand reputation.
Marketplace Fragmentation:
8
compare offerings effectively. Fragmentation also leads to inconsistencies in pricing,
product information, and customer service standards, complicating decision-making
processes for users.
Objective:-
Describe the main goal of the eCommerce website (e.g., selling products, customer
engagement, scaling business operations)
1. Project Overview
Objective: Describe the main goal of the eCommerce website (e.g., selling
products, customer engagement, scaling business operations).
Background: Provide context or background information why the project is
being initiated.
Scope Statement: Briefly define what the project will deliver and outline the
boundaries of the project.
9
Shopping Cart and Checkout Process: Mechanisms for adding items to a cart
and securely processing payments.
User Account System: Registration, user profiles, order history, and account
management.
Search Functionality: Advanced search options by various filters like price,
category, brand, etc.
Security Features: Implementations to ensure data protection, secure
transactions, and compliance with relevant standards (e.g., PCI DSS for payment
security).
Customer Support Features: email support, and customer service tools.
Backend Management: Admin panel for managing products, orders, customers,
and other backend functionalities.
3. Technology Stack
Frontend: Technologies like HTML, CSS, JavaScript, Bootstrap.
Backend: Server, database, and application logic technologies such as Python
Django.
Database: .Python Django admin.
Hosting/Cloud Services: AWS, Azure, or Google Cloud for hosting and storage
needs.
4. Project Deliverables
Design Mockups: Visual designs of the website's layout and user interface.
Technical Specifications: Detailed documentation of the architecture and
technologies used.
Development Milestones: Phased breakdown of development stages.
Testing Reports: Documentation of testing phases, issues found, and their
resolutions.
User Manuals/Documentation: Guides for users and administrators on how to
use the website.
5. Timeline
Project Kick-off: Start date of the project.
Milestones: Key milestones with expected completion dates.
Final Delivery: Expected launch date of the website.
6. Budget
Estimate Costs: Breakdown of costs associated with each phase or deliverable of
the project.
Payment Terms: Schedule for payments based on milestones or specific dates.
10
7. Roles and Responsibilities
Project Manager: Oversees the project, ensuring it stays on track with scope,
budget, and timeline.
Developers: Responsible for the coding of the website.
Designers: Handle the visual elements of the website.
Quality Assurance: Ensure the site works as expected and is bug-free.
Marketing Team: Plan and execute marketing strategies.
10. Approval
Sign-off: Names and signatures of key stakeholders approving the project scope.
1.3 MODULES:
The entire project mainly consists of 1 modules, which are
Admin module
User registration
User login/logout
11
User profile management
Product Management:
Product catalog management
Product categories and subcategories
Product attributes and variations (e.g., size, color)
Product search and filtering
Shopping Cart and Checkout:
Adding/removing items to/from cart
Viewing/editing cart contents
Proceeding to checkout
Multiple payment options (credit/debit card, PayPal, etc.)
Order summary and confirmation
Order Management:
Order processing
Generating invoices
Order tracking and status updates
Managing returns and refunds
Search and Navigation:
Advanced search functionality (keyword, category, filters)
Autocomplete suggestions
Faceted search (filtering by attributes)
Sorting options (price, popularity, etc.)
User Reviews and Ratings:
Allowing users to leave reviews and ratings for products
Displaying average ratings and reviews on product pages
Moderation tools for managing reviews (approve, delete, flag)
Product Recommendations:
Personalized product recommendations based on user behavior and preferences
Related products/up-sells/cross-sells on product pages and checkout
Security and Compliance:
Implementing security measures (SSL encryption, firewall, secure authentication)
Compliance with data protection regulations (GDPR, CCPA)
Regular security audits and vulnerability assessments
Customer Support:
Live chat support
Help desk/ticketing system
12
Knowledge base/FAQs
Marketing and Promotions:
Discount codes/coupons
Newsletter subscriptions
Promotional banners and pop-ups
CHAPTER 2
REQUIREMENT SPECIFICATION
2.1 INTRODUCTION:
Requirement Specification document for an eCommerce website involves summarizing
key information that gives readers (typically project stakeholders and the development
team) a clear overview of the project's goals, scope, and relevance. This section sets the
stage for more detailed descriptions in the subsequent parts of the document.
RAM : 8 GB
HARD DISK : 1 TB
DATABASE : Django
CHAPTER 3
ANALYSIS
3.1 EXISTING SYSTEM:
The existing system in an e-commerce website comprises a comprehensive platform
designed to facilitate online retail operations and transactions between businesses and
consumers. At its core, the website features a user-friendly interface, offering intuitive
navigation and visually appealing layouts across various pages, including home, product
listings, and checkout. Users can create accounts, log in securely, and manage their
profiles, including personal information and order histories. The product catalog is
meticulously managed, allowing administrators to add, update, and categorize products
with detailed descriptions, images, and pricing. A robust shopping cart system enables
users to add items, review their selections, and proceed seamlessly through the checkout
process, which includes selecting shipping methods and completing secure transactions
through integrated payment gateways.
HTML:
HTML or Hypertext Markup Language is the standard markup language used to
create web pages.
HTML is written in the form of HTML elements consisting of tags enclosed in angle
brackets (like <html>). HTML tags most commonly come in pairs like <h1> and </h1>,
although some tags represent empty elements and so are unpaired, for example <img>.
The first tag in a pair is the start tag, and the second tag is the end tag (they are also
15
called opening tags and closing tags). Though not always necessary, it is best practice to
append a slash to tags which are not paired with a closing tag.
The purpose of a web browser is to read HTML documents and compose them into
visible or audible web pages. The browser does not display the HTML tags, but uses the
tags to interpret the content of the page. HTML describes the structure of a website
semantically along with cues for presentation, making it a markup language rather than
a programming language.
HTML elements form the building blocks of all websites. HTML allows images and
objects to be embedded and can be used to create interactive forms. It provides a means
to create structured documents by denoting structural semantics for text such as headings,
paragraphs, lists, links, quotes and other items. It can embed scripts written in languages
such as JavaScript which affect the behavior of HTML web pages.
MySQL:
16
MySQL is developed, distributed, and supported by Oracle Corporation. MySQL is a
database system used on the web it runs on a server. MySQL is ideal for both small and
large applications. It is very fast, reliable, and easy to use. It supports standard SQL.
MySQL can be compiled on a number of platforms.
FEATURES OF MySQL:
Security:
A privilege and password system that is very flexible and secure, and that enables
host-based verification.
Password security by encryption of all password traffic when you connect to a server.
Support for up to 64 indexes per table (32 before MySQL 4.1.2). Each index may
consist of 1 to 16 columns or parts of columns. The maximum index width is 767
bytes for InnoDB tables, or 1000 for MyISAM; before MySQL 4.1.2, the limit is 500
bytes. An index may use a prefix of a column for CHAR, VARCHAR, BLOB,
or TEXT column types.
CONNECTIVITY:
Clients can connect to MySQL Server using several protocols:
17
Clients can connect using TCP/IP sockets on any platform.
On Windows systems in the NT family (NT, 2000, XP, 2003, or Vista), clients
can connect using named pipes if the server is started with the --enable-named-
pipe option. In MySQL 4.1 and higher, Windows servers also support shared-
memory connections if started with the --shared-memory option. Clients can
connect through shared memory by using the --protocol=memory option.
On UNIX systems, clients can connect using Unix domain socket files.
LOCALIZATION:
The server can provide error messages to clients in many languages.
All data is saved in the chosen character set.
CLIENTS AND TOOLS:
MySQL includes several client and utility programs. These include both
command-line programs such as mysqldump and mysqladmin, and
graphical programs such as MySQL Workbench.
MySQL Server has built-in support for SQL statements to check, optimize,
and repair tables. These statements are available from the command line
through the mysqlcheck client. MySQL also includes myisamchk, a very
fast command-line utility for performing these operations
on MyISAM tables.
MySQL programs can be invoked with the --help or -? option to obtain
online assistance.
PYTHON:
18
Python is a versatile programming language that can be incredibly useful in the
context of ecommerce. With its simplicity and readability, Python allows
developers to quickly build and deploy ecommerce solutions, making it an ideal
choice for businesses looking to create efficient and scalable online stores..
PYHON PROPERTIES:
19
CHAPTER 4
DESIGN
4.1 SYSTEM DESIGN:
4.1.1INTRODUCTION TO UML:
UML Design
A UML design for a Library Management System includes a class diagram with
classes such as Book, Member, and Library, illustrating their relationships and attributes.
Associations depict how Members borrow Books, and aggregations show how Books are
part of the Library. Use case diagrams outline interactions, covering scenarios like
borrowing and returning books. A sequence diagram showcases the flow of actions
during a book checkout. Additionally, state diagrams model the lifecycle of a Book or
Member, transitioning between states like available, borrowed, or suspended. The design
ensures a comprehensive representation of the system's structure, behavior, and user
interactions
A UML
such asathe
borrowing
during
Member,
ensures Book,
Associations
part of book
interactions in
adesign
and aareturning
Library.concise
Member,
for
indepict aUse
how
checkout.
transitioning
comprehensive
concise manner.
Library
and
case Library,
Management
Members
diagrams
Additionally,
books.
between
manner. illustrating
borrow
A sequence
representation
states state
like System
outline
Books, their
diagrams
diagram
ofavailable,
the includes
system's relationships
interactions,
and athe
showcases
model
borrowed, class
aggregations
covering
structure,
or diagram
and
showattributes.
with
scenarios
lifecycle
the flow
behavior, how
of
suspended. classes
like
Books
actions
a Book
and
Theuseror are
design
The UML is a language for:
Visualizing
Navigation
Presentation
Responsive
Visualizing
20
Through UML we see or visualize an existing system and ultimately we visualize
how the system is going to be after implementation. Unless we think, we cannot implement.
UML helps to visualize, how the components of the system communicate and interact with
each other.
Navigation
The Library Management System's UML design includes key navigation
components. The system comprises classes like Book, Member, and Transaction,
interconnected through associations. Navigation involves creating instances, such as
adding a Book to the catalog or registering a Member. The system allows searching for
books and checking availability, with associations enabling transactions like borrowing
and returning. Utilizing use case diagrams, it illustrates interactions between actors (e.g.,
Librarian, Member). Class diagrams showcase relationships, and sequence diagrams
depict the flow during operations like book checkout. Overall, the UML design ensures
efficient navigation and interaction within the Library Management System, enhancing
functionality and user experience.
Presentation
The Library Management System is a comprehensive software solution designed
to streamline library operations. It facilitates efficient cataloging, tracking, and retrieval
of books, ensuring seamless resource management. Users can easily search for and
borrow books, while administrators manage inventory, memberships, and overdue fines
effortlessly. The system's user-friendly interface enhances accessibility, promoting a
smooth library experience for both staff and patrons. Additionally, it incorporates
features like real-time data updates, automated notifications, and analytics tools to
optimize library performance. Overall, the Library Management System modernizes
library administration, promoting organizational efficiency and an enhanced user
experience.
Responsive
A responsive library management system adapts seamlessly to various devices and
screen sizes, ensuring an optimal user experience. Whether accessed on desktops, tablets,
or smartphones, the system's interface dynamically adjusts, maintaining functionality and
readability. This responsiveness enhances accessibility and usability, allowing librarians
and patrons to efficiently manage and access library resources from any device. This
adaptability not only improves user satisfaction but also promotes effective information
retrieval and management, contributing to the overall efficiency and effectiveness of the
library's operations.
Use case diagrams are formally included in two modeling languages defined by
the OMG:theunfied modeling language(UML) and the systems modeling
language(sysML)
22
SYSTEM DESIGN AND SPECIFICATIONS
The system design and specifications for this project outline the
architecture, components, and functionality of the collaborative music
playback system. Here's an overview:
Architecture:
The system follows a client-server architecture, where the server hosts the
backend logic and data storage, while the client interacts with the user through
a web-based interface.
Backend components include Django framework for server-side logic, Spotify API
integration for music playback functionality, and a PostgreSQL database for
storing user data and room information.
Frontend components utilize React.js for building interactive user interfaces and
managing state.
23
Components:
Backend Components:
PostgreSQL database for storing user profiles, room details, playback history,
and voting data.
Frontend Components:
Material-UI library for designing responsive and visually appealing user interfaces.
React Router for client-side routing to navigate between different views within
the application.
Functionality:
User Authentication: Users can log in to the system using their Spotify accounts
to access the collaborative music playback features.
Room Management: Hosts can create a room and generate a unique code that
other users can use to join the room. Hosts can also set room preferences such
as playback control permissions and voting requirements.
Music Playback: Users can play, pause, skip tracks, and adjust playback volume
24
within the room. Playback control permissions are determined by the host's
settings.
Voting System: Users can vote to skip tracks, and tracks are skipped when
the required number of votes is reached.
Real-time Updates: Hosts can update playback control settings and voting
requirements in real-time, reflecting changes immediately for all users in the
room.
Specifications:
SOFTWARE DESIGN
MODULE DESIGN
The major modules of the project are:
Home Module
Home Module:
26
Provides options for users to create or join rooms..
Retrieves user profile information and access tokens for Spotify API interaction.
27
Allows hosts to modify playback control permissions, voting rules, etc.
Displays information about the currently playing song, including the title,
artist, album cover, playback progress, and voting details.
Users can interact with the music player through buttons such as play,
pause, and skip. These buttons trigger actions to control the playback
accordingly.
It also displays the number of votes each song has received for skipping
DATABASE DESIGN
MODEL NAME: Room
Field name Data Type
code CharField
host CharField
guest_can_pause BooleanField
votes_to_skip IntegerField
created_at DateTimeField
current_song CharField
28
user CharField
created_at DateTimeField
refresh_token CharField
access_token CharField
expires_in DateTimeField
token_type CharField
user CharField
created_at DateTimeField
song_id CharField
room CharField
INPUT/OUTPUT DESIGN
Input Design
The input design for the collaborative music playback system involves
defining how users interact with the application to input commands,
preferences, and data. Here's an overview of the input design:
Users interact with these elements to perform actions like logging in, creating
rooms, joining rooms, controlling playback, and voting on tracks.
29
Authentication Inputs:
Input fields for users to enter their login credentials (username/email and
password) during the authentication process.
Playback control buttons for playing, pausing, skipping tracks, adjusting volume,
and seeking within tracks.
30
Voting Inputs:
Output Design
❖ The output design of the project involves presenting information and
feedback to users based on their interactions with the system. Here's an
overview of the output design elements in our collaborative music playback
system:
User Interface: The system provides a user-friendly interface using React and
Material-UI components. It includes screens for different functionalities like
home, room creation, room joining, music playback, and settings.
Room Information: Upon joining a room or creating a new one, users see
relevant information such as the room code, current song details, playback
controls, and voting status.
Music Playback: The output design includes a music player interface with
controls for play, pause, and skip. It also displays the current song's title, artist,
album cover, playback progress, and voting details.
31
DATA MODEL(LIKE DFD)
It shows how data enters and leaves the system, what changes the
information, and where data is stored.
LEVEL 0 DFD
This is the highest-level DFD, which provides an overview of the entire
system. It shows the major processes, data flows, and data stores in the
system, without providing any details about the internal workings of these
processes.
33
It is also known as a context diagram. It’s designed to be an abstraction
view, showing the system as a single process with its relationship to
external entities. It represents the entire system as a single bubble with
input and output data indicated by incoming/outgoing arrows.
Level 1 DFD
This level provides a more detailed view of the system by breaking down
the major processes identified in the level 0 DFD into sub-processes. Each
sub-process is depicted as a separate process on the level 1 DFD. The data
flows and data stores associated with each sub-process are also shown.
34
ENTITY RELATIONSHIP MODEL
ER model stands for an Entity-Relationship model. It is a high-level data
model. This model is used to define the data elements and relationship for a
specified system.
36
37
5.1 CLASS DIAGRAM
Class diagrams are a type of UML (Unified Modeling Language) diagram used in
software engineering to visually represent the structure and relationships of
classes within a system
CHAPTER 5
SYSTEM IMPLEMENTATION
5. IMPLEMENTATION:
5.1 Inroduction:
Implementation is the stage of the project when the theoretical design is turned out into
a working system. Thus it can be considered to be the most critical stage in achieving a
successful new system and in giving the user, confidence that the new system will work
and be effective.
38
The implementation stage involves careful planning, investigation of the existing system
and it’s constraints on implementation, designing of methods to achieve changeover and
evaluation of changeover methods.
39
29. />
30.
31. <link
32. href="{% static '/assets/vendor/glightbox/css/glightbox.min.css' %}"
33. rel="stylesheet"
34. />
35. <link
36. href="{% static '/assets/vendor/remixicon/remixicon.css' %}"
37. rel="stylesheet"
38. />
39. <link
40. href="{% static '/assets/vendor/swiper/swiper-bundle.min.css' %}"
41. rel="stylesheet"
42. />
43.
44. <link href="{% static '/assets/css/style.css' %}" rel="stylesheet" />
45. <link
46.
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
47. rel="stylesheet"
48. />
49. <link
50. rel="stylesheet"
51. href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/6.5.2/css/all.min.css"
52. integrity="sha512-
SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX
3pBnMFcV7oQPJkl9QevSCWr3W6A=="
53. crossorigin="anonymous"
54. referrerpolicy="no-referrer"
55. />
56. </head>
40
57.
58. <body>
59. <!-- ======= Header ======= -->
60. <header id="header" class="fixed-top">
61. <div class="container d-flex align-items-center justify-content-between">
62. <a href="/" class="logo"
63. ><img
64. src="{% static '/assets/img/logo.png'%}"
65. alt="error"
66. class="img-fluid"
67. style="max-width: 300px; height: 300px"
68. /></a>
69.
70. <nav id="navbar" class="navbar">
71. <ul>
72. <li><a class="nav-link scrollto" href="/">Home</a></li>
73. <li><a class="nav-link scrollto" href="/about">About</a></li>
74. <li><a class="nav-link scrollto" href="/checkout/">Checkout</a></li>
75. <li>
76. <a class="nav-link scrollto" href="/profile"
77. >My Profile <i class="fa-regular fa-user"></i
78. ></a>
79. </li>
80. <button
81. type="button"
82. class="nav-link scrollto bg-danger p-3 m-2 text-white"
83. id="popcart"
84. data-container="body"
85. data-toggle="popover"
86. data-placement="bottom"
87. data-html="true"
88. >
41
89. <i class="fa-solid fa-cart-shopping"></i> Cart(<span id="cart"
90. >0</span
91. >)
92. </button>
93.
94. {% if request.user.is_authenticated %}
95. <li>
96. <a class="nav-link scrollto" href="/auth/logout/"
97. >Log Out <i class="fa-solid fa-right-from-bracket"></i
98. ></a>
99. </li>
100. {% else %}
101. <li class="dropdown">
102. <a href="#"
103. ><span>Sign In <i class="fa-solid fa-user"></i></span>
104. <i class="bi bi-chevron-down"></i
105. ></a>
106. <ul>
107. <li>
108. <a href="/auth/signup/"
109. >Sign Up <i class="fa-solid fa-user"></i
110. ></a>
111. </li>
112. <li>
113. <a href="/auth/login/"
114. >Log In <i class="fa-solid fa-user"></i
115. ></a>
116. </li>
117. </ul>
118. </li>
119. {% endif %}
120. <li>
42
121. <a class="nav-link scrollto p-2 m-2" href="/contact"
122. >Contact<i class="fa-solid fa-address-card"></i
123. ></a>
124. </li>
125. </ul>
126. <i class="bi bi-list mobile-nav-toggle"></i>
127. </nav>
128. </div>
129. </header>
130. <!-- End Header -->
131.
132. <!-- ======= Hero Section ======= -->
133. <section id="hero">
134. <div class="hero-container">
135. {% block content %} {% endblock content %}
136. </div>
137. </section>
138. <!-- End Hero -->
139.
140. <main id="main">{% block body %} {% endblock body %}</main>
141.
142. <!-- ======= Footer ======-->
143. <footer id="footer">
144. <div class="footer-top">
145. <div class="container">
146. <div class="row">
147. <div class="col-lg-3 col-md-6 footer-contact">
148. <h3>Shopify</h3>
149. <p>
150. Rajnagar College Street <br />
151. Kendrapara,Odisha<br />
43
152. India,754225 <br /><br />
153. <strong>Phone:</strong> 8459624632<br />
154. <strong>Email:</strong> [email protected]<br />
155. </p>
156. </div>
157.
158. <div class="col-lg-2 col-md-6 footer-links">
159. <h4>Useful Links</h4>
160. <ul>
161. <li>
162. <i class="bx bx-chevron-right"></i> <a href="/">Home</a>
163. </li>
164. <li>
165. <i class="bx bx-chevron-right"></i>
166. <a href="/about">About us</a>
167. </li>
168. <li>
169. <i class="bx bx-chevron-right"></i>
170. <a href="/service">Services</a>
171. </li>
172. <li>
173. <i class="bx bx-chevron-right"></i>
174. <a href="#">Terms of service</a>
175. </li>
176. <li>
177. <i class="bx bx-chevron-right"></i>
178. <a href="#">Privacy policy</a>
179. </li>
180. </ul>
181. </div>
182.
183. <div class="col-lg-3 col-md-6 footer-links">
44
184. <h4>Our Services</h4>
185. <ul>
186. <li>
187. <i class="bx bx-chevron-right"></i> <a href="#">Web Design</a>
188. </li>
189. <li>
190. <i class="bx bx-chevron-right"></i>
191. <a href="#">Web Development</a>
192. </li>
193. <li>
194. <i class="bx bx-chevron-right"></i>
195. <a href="#">Product Management</a>
196. </li>
197. <li>
198. <i class="bx bx-chevron-right"></i> <a href="#">Marketing</a>
199. </li>
200. <li>
201. <i class="bx bx-chevron-right"></i>
202. <a href="#">Graphic Design</a>
203. </li>
204. </ul>
205. </div>
206.
207. <div class="col-lg-4 col-md-6 footer-newsletter">
208. <h4>Join with us</h4>
209. <p>Together, we can make the world a better place.</p>
210. <form action="" method="post">
211. <input type="email" name="email" /><input
212. type="submit"
213. value="Subscribe"
214. />
215. </form>
45
216. </div>
217. </div>
218. </div>
219. </div>
220.
221. <div class="container d-md-flex py-4">
222. <div class="me-md-auto text-center text-md-start">
223. <div class="copyright">
224. © Copyright <strong><span>Shopify</span></strong
225. >. All Rights Reserved
226. </div>
227. <div class="credits">
228. Designed by <a href="https://bootstrapmade.com/">BBB Group</a>
229. </div>
230. </div>
231. <div class="social-links text-center text-md-right pt-3 pt-md-0">
232. <a href="#" class="twitter"><i class="bi bi-telegram"></i></a>
233. <a href="#" class="facebook"><i class="bi bi-meta"></i></a>
234. <a href="#" class="instagram"><i class="bi bi-instagram"></i></a>
235. <a href="#" class="google-plus"><i class="bi bi-skype"></i></a>
236. <a href="#" class="linkedin"><i class="bi bi-linkedin"></i></a>
237. </div>
238. </div>
239. </footer>
240. <a
241. href="#"
242. class="back-to-top d-flex align-items-center justify-content-center"
243. ><i class="bi bi-arrow-up-short"></i
244. ></a>
245.
246. <!-- JS Files -->
46
247. <script src="{% static '/assets/vendor/bootstrap/js/bootstrap.bundle.min.js '
%}"></script>
248. <script src="{% static '/assets/vendor/glightbox/js/glightbox.min.js'
%}"></script>
249. <script src="{% static '/assets/vendor/isotope-layout/isotope.pkgd.min.js '
%}"></script>
250. <script src="{% static '/assets/vendor/swiper/swiper-bundle.min.js '
%}"></script>
251. <script src="{% static '/assets/vendor/php-email-form/validate.js '
%}"></script>
252.
253. <!-- JS File -->
254. <script src="{% static '/assets/js/main.js' %}"></script>
255. </body>
256. </html>
47
273. aria-label="Close"
274. ></button>
275. </div>
276. {% endfor %}
277.
278. <div class="section-title">
279. <h2>WELCOME TO SHOP</h2>
280. <h3>Check our <span>Products</span></h3>
281. </div>
282.
283. {% for product,range,nSlides in allProduct %} {% comment %} filter out the
284. category {% endcomment %}
285. <h3 class="my-3 text-center text-success bg-light">
286. {{product.0.category}}
287. </h3>
288. <div class="container">
289. <div class="row">
290. {% for i in product %}
291.
292. <div class="col-md-3 mt-3">
293. <img
294. src="/media/{{i.image}}"
295. class="card-img-top"
296. alt="..."
297. height="200px"
298. width="150px"
299. />
300. <div class="card-body">
301. <h5 class="card-title" id="namepr{{i.id}}">
302. {{i.product_name|slice:"0:10"}} ...
303. </h5>
304. <p class="card-text">{{i.desc|slice:"0:20"}} ...</p>
48
305. <h6 class="card-title">
306. Price:<span id="pricepr{{i.id}}">{{i.price}}</span>
307. </h6>
308. <span id="divpr{{i.id}}" class="divpr">
309. <button id="pr{{i.id}}" class="btn btn-danger cart btn-sm mt-0">
310. AddToCart<i class="fa-solid fa-cart-shopping"></i>
311. </button>
312. </span>
313.
314. <a href="/media/{{i.image}}"
315. ><button id="test" class="btn btn-dark btn-sm cart">
316. <i class="fa-solid fa-eye"></i>
317. </button></a
318. >
319. </div>
320. </div>
321. {% endfor %}
322. </div>
323. </div>
324. {% endfor %}
325. </div>
326. </section>
327.
328. <script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-
2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
crossorigin="anonymous"></script>
329. <script
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"
integrity="sha384-
wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6Z
Oblgut" crossorigin="anonymous"></script>
49
330. <script
src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"
integrity="sha384-
B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv
9k" crossorigin="anonymous"></script>
331.
332.
333. <script>
334.
335. if (localStorage.getItem('cart')==null){
336. var cart={}
337. }else{
338. cart=JSON.parse(localStorage.getItem("cart"))
339. updateCart(cart)
340. }
341.
342. {% comment %} button.cart is a function {% endcomment %}
343.
344.
345. $('.divpr').on('click','button.cart',function(){
346. var idstr=this.id.toString();
347. console.log(idstr);
348.
349.
350. if(cart[idstr]!=undefined){
351. qty=cart[idstr][0]+1;
352.
353. }else{
354. qty=1;
355. {% comment %} name+ pr{{1}} ==namepr{{1}} {%
endcomment %}
356. name=document.getElementById('name'+idstr).innerHTML;
50
357. price=document.getElementById('price'+idstr).innerHTML;
358. cart[idstr]=[qty,name,price];
359. console.log(cart)
360. }
361. updateCart(cart);
362. localStorage.setItem('cart', JSON.stringify(cart));
363. document.getElementById('cart').innerHTML = Object.keys(cart).length;
364. console.log( Object.keys(cart).length)
365. document.getElementById("popcart").click();
366. })
367.
368.
369.
370. $('#popcart').popover();
371. updatePopover(cart);
372. function updatePopover(cart) {
373.
374.
375. console.log('we are inside update popover');
376.
377. var popStr = "";
378. var popStr = popStr + "<h5> cart for your items in my shopping cart </h5>
<div class='mx-2 my-2'>";
379. var i = 1;
380. for (var item in cart) {
381. popStr = popStr + "<b>" + i + "</b>. ";
382. popStr = popStr + document.getElementById('name' +
item).innerHTML.slice(0, 19) + "..." + "<b>" +cart[item][0] + "</b>"+ "Qty" +
'<br>';
383. i = i + 1;
384. }
385.
51
386. popStr = popStr + "</div> <a href='/checkout/'><button class='btn btn-
success' id='clearCart'>Checkout</button></a> <button class='btn btn-dark'
onclick='clearCart()' id='clearCart'>ClearCart</button>"
387. document.getElementById('popcart').setAttribute('data-content', popStr);
388. $('#popcart').popover('show');
389. document.getElementById("popcart").click();
390. }
391.
392. function clearCart() {
393. cart = JSON.parse(localStorage.getItem('cart'));
394. for (var item in cart) {
395. document.getElementById('div' + item).innerHTML = '<button id="' +
item + '" class="btn btn-danger cart">AddtoCart <i class="fa-solid fa-cart-
shopping"></i> <i class="fa-solid fa-cart-shopping"></i></button>'
396. }
397. localStorage.clear();
398. cart = {};
399. updateCart(cart);
400.
401. let clear= document.getElementById("popcart").click();
402. document.getElementById("popcart").click();
403.
404. }
405.
406. function updateCart(cart) {
407. var sum = 0;
408. for (var item in cart) {
409. sum = sum + cart[item][0];
410. document.getElementById('div' + item).innerHTML = "<button
id='minus" + item + "'class='btn btn-success minus'>-</button> <span id='val" +
item + "''>" + cart[item][0] + "</span> <button id='plus" + item + "' class='btn
btn-success plus'> + </button>";
52
411. }
412. localStorage.setItem('cart', JSON.stringify(cart));
413. document.getElementById('cart').innerHTML = sum;
414. console.log(cart);
415. updatePopover(cart);
416. document.getElementById("popcart").click();
417. }
418.
419. //if plus or minus button is clicked change the cart as well as the display value
420. $('.divpr').on("click", "button.minus", function() {
421.
422. a = this.id.slice(7, );
423. cart['pr' + a][0] = cart['pr' + a][0] - 1;
424. cart['pr' + a][0] = Math.max(0, cart['pr' + a][0]);
425. document.getElementById('valpr' + a).innerHTML = cart['pr' + a][0];
426. updateCart(cart);
427.
428.
429. })
430.
431.
432. $('.divpr').on("click", "button.plus", function() {
433.
434. a = this.id.slice(6, );
435. cart['pr' + a][0] = cart['pr' + a][0] + 1;
436. document.getElementById('valpr' + a).innerHTML = cart['pr' + a][0];
437. updateCart(cart);
438. })
439. </script>
440. {% endblock body %
53
Ecommereceapp.views:-
54
MERCHANT_KEY = keys.MK
@csrf_exempt
def index(request):
allProduct = []
catprods = Product.objects.values('category', 'id')
cats = {item['category'] for item in catprods}
numprod = len(prod)
@csrf_exempt
def contact(request):
if request.method == 'POST':
name = request.POST['name']
email = request.POST['email']
desc = request.POST['desc']
number = request.POST['pnumber']
myquery = Contact(name=name, email=email,
desc=desc, phonenumber=number)
myquery.save()
55
messages.info(request, "Message Sent Successfully")
return redirect('/contact')
@csrf_exempt
def about(request):
print("hello")
return render(request, 'about.html')
@csrf_exempt
def checkout(request):
if not request.user.is_authenticated:
messages.warning(request, "Login & Try Again")
return redirect('/auth/login')
if request.method == "POST":
items_json = request.POST.get('itemsJson', '')
name = request.POST.get('name', '')
amount = int(request.POST.get('amt'))
email = request.POST.get('email', '')
address1 = request.POST.get('address1', '')
address2 = request.POST.get('address2', '')
city = request.POST.get('city', '')
state = request.POST.get('state', '')
zip_code = request.POST.get('zip_code', '')
phone = request.POST.get('phone', '')
Order = Orders(items_json=items_json, name=name, amount=amount, email=email,
address1=address1,
56
address2=address2, city=city, state=state, zip_code=zip_code,
phone=phone)
Order.save()
value = Order.email
update = OrderUpdate(order_id=Order.order_id,
update_desc="the order has been placed", email=email)
update.save()
thank = True
return render(request, 'paytm.html', {'value': email, 'id': Order.order_id})
@csrf_exempt
def paym(request, data):
if request.method == 'POST':
value = request.POST.get('value')
amountpaid = request.POST.get('amountpaid')
print(amountpaid)
print(type(amountpaid))
if amountpaid == '0':
paymentstatus = "COD"
else:
paymentstatus = "PAID"
card_no = request.POST.get('card_number')
cvv_no = request.POST.get('cvv')
payment = Payment(email=value, amountpaid=amountpaid, oid=data,
paymentstatus=paymentstatus, card_no=card_no, cvv_no=cvv_no)
payment.save()
return render(request, "index.html")
57
return render(request, 'paytm.html')
@csrf_exempt
def profile(request):
if not request.user.is_authenticated:
messages.warning(request, "Login & Try Again")
return redirect('/auth/login')
currentuser = request.user.username
items = Orders.objects.filter(email=currentuser)
if items.exists():
ll = set()
for i in items:
myid = i.order_id
ll.add(myid)
status = OrderUpdate.objects.filter(order_id__in=ll)
# for j in status:
# print(j.update_desc)
@csrf_exempt
def cancel(request, data):
print("cancel")
58
items = Payment.objects.filter(oid=data)
for obj in items:
Orders.objects.filter(order_id=obj.oid).delete()
OrderUpdate.objects.filter(order_id=obj.oid).delete()
Payment.objects.filter(oid=obj.oid).delete()
@csrf_exempt
def returnPrd(request, data):
print("return")
print(type(data))
if request.method == "POST":
items = Payment.objects.filter(oid=data)
for i in items:
price = i.amountpaid
email = request.POST.get('email')
reason = request.POST.get('reason')
account = request.POST.get('account')
order = ReturnRequest(oid=data, email=email,
price=price, bankaccount=account, reason=reason)
order.save()
items = Payment.objects.filter(oid=data)
for obj in items:
Orders.objects.filter(order_id=obj.oid).delete()
OrderUpdate.objects.filter(order_id=obj.oid).delete()
Payment.objects.filter(oid=obj.oid).delete()
authentication.views:-
def signup(request):
if request.method == 'POST':
email = request.POST['email']
password1 = request.POST['pass1']
password2 = request.POST['pass2']
if password1 != password2:
messages.warning(request, "Password not matching")
return render(request, 'signup.html')
else:
try:
if User.objects.get(username=email):
messages.info(request, "Email already exist")
return redirect('/auth/signup')
60
except Exception as e:
pass
email_msg = EmailMessage(
email_subject, message, settings.EMAIL_HOST_USER, [email])
email_msg.send()
messages.info(
request, "Please check your mail to activate the account ")
return redirect('/auth/login')
class ActivateAccountView(View):
def get(self, request, uidb64, token):
try:
uid = force_str(urlsafe_base64_decode(uidb64))
user = User.objects.get(pk=uid)
except Exception as e:
user = None
61
if user is not None:
user.is_active = True
user.save()
messages.info(request, "Account Activated Successfully")
return redirect('/auth/login')
return render(request, 'activatefail.html')
def handlelogin(request):
if request.method == 'POST':
username = request.POST['email']
password = request.POST['password']
user = authenticate(username=username, password=password)
def handlelogout(request):
messages.info(request, "Logged out Successfully")
logout(request)
return redirect('/auth/login')
62
class RequestResetEmailView(View):
def get(self, request):
return render(request, 'request-reset-email.html')
if user.exists():
# current_site=get_current_site(request)
email_subject = '[Reset Your Password]'
message = render_to_string('reset-user-password.html', {
'domain': '127.0.0.1:8000',
'uid': urlsafe_base64_encode(force_bytes(user[0].pk)),
'token': PasswordResetTokenGenerator().make_token(user[0])
})
print(message)
email_message = EmailMessage(
email_subject, message, settings.EMAIL_HOST_USER, [email])
email_message.send()
messages.info(
request, f"WE HAVE SENT YOU AN EMAIL WITH INSTRUCTIONS ON
HOW TO RESET THE PASSWORD {message} ")
return render(request, 'request-reset-email.html')
class SetNewPasswordView(View):
def get(self, request, uidb64, token):
context = {
'uidb64': uidb64,
'token': token
63
}
try:
user_id = force_str(urlsafe_base64_decode(uidb64))
user = User.objects.get(pk=user_id)
try:
user_id = force_str(urlsafe_base64_decode(uidb64))
user = User.objects.get(pk=user_id)
user.set_password(password)
user.save()
messages.success(
request, "Password Reset Success Please Login with NewPassword")
64
return redirect('/auth/login/')
Login.html:-
{% extends "base.html" %} {% block title %} SignUp {% endblock title %}
{% block content %}
<div class="card bg-transparent mt-5 px-5 p-5 border border-white">
<h2 class="text-light">Login</h2>
urlpatterns = [
66
path('', views.index, name='index'),
path('contact', views.contact, name='contact'),
path('about', views.about, name='about'),
path('checkout/', views.checkout, name='checkout'),
path('payment/<str:data>', views.paym, name='paym'),
path('profile', views.profile, name='profile'),
path('cancel/<str:data>', views.cancel, name='cancel'),
path('returnPrd/<str:data>', views.returnPrd, name='returnPrd'),
]
Ecommereceapp.models:-
from django.db import models
class Contact(models.Model):
name = models.CharField(max_length=50)
email = models.EmailField()
desc = models.TextField(max_length=50)
phonenumber = models.IntegerField()
def __str__(self):
return self.name
class Product(models.Model):
product_id = models.AutoField
product_name = models.CharField(max_length=100)
category = models.CharField(max_length=100, default="")
subcategory = models.CharField(max_length=50, default="")
price = models.IntegerField(default=0)
67
desc = models.CharField(max_length=300)
image = models.ImageField(upload_to='images')
def __str__(self):
return self.product_name
class Cart(models.Model):
product_id = models.AutoField
product_name = models.CharField(max_length=100)
category = models.CharField(max_length=100, default="")
subcategory = models.CharField(max_length=50, default="")
price = models.IntegerField(default=0)
desc = models.CharField(max_length=300)
image = models.ImageField(upload_to='images')
def __str__(self):
return self.product_name
class Orders(models.Model):
order_id = models.AutoField(primary_key=True)
items_json = models.CharField(max_length=5000)
amount = models.IntegerField(default=0)
name = models.CharField(max_length=90)
email = models.CharField(max_length=90)
address1 = models.CharField(max_length=200)
address2 = models.CharField(max_length=200)
city = models.CharField(max_length=100)
state = models.CharField(max_length=100)
zip_code = models.CharField(max_length=100)
phone = models.CharField(max_length=100, default="")
68
def __str__(self):
return str(self.order_id)+"id"
class Payment(models.Model):
oid = models.CharField(max_length=500, blank=True, null=True)
email = models.CharField(max_length=500, blank=True, null=True)
amountpaid = models.CharField(max_length=500, blank=True, null=True)
paymentstatus = models.CharField(max_length=20, blank=True)
card_no = models.CharField(max_length=20, blank=True)
cvv_no = models.CharField(max_length=20, blank=True)
def __str__(self):
return str(self.oid)+"id"
class ReturnRequest(models.Model):
oid = models.CharField(max_length=500, blank=True, null=True)
email = models.CharField(max_length=500, blank=True, null=True)
reason = models.CharField(max_length=500, blank=True, null=True)
bankaccount = models.CharField(max_length=500, blank=True, null=True)
price=models.CharField(max_length=500, blank=True, null=True)
def __str__(self):
return self.oid
class OrderUpdate(models.Model):
update_id = models.AutoField(primary_key=True)
email = models.CharField(max_length=500, blank=True, null=True)
order_id = models.IntegerField(default="")
update_desc = models.CharField(max_length=5000)
delivered = models.BooleanField(default=False)
timestamp = models.DateField(auto_now_add=True)
def __str__(self):
return str(self.order_id)+"id"
69
admin.py:-
from django.contrib import admin
from ecommerceapp.models import Contact, Product, Orders,
OrderUpdate,Payment,ReturnRequest
# Register your models here.
admin.site.register(Contact)
admin.site.register(Product)
admin.site.register(Orders)
admin.site.register(OrderUpdate)
admin.site.register(Payment)
admin.site.register(ReturnRequest)
authentication views.py:-
from django.shortcuts import render, redirect, HttpResponse
from django.contrib.auth.models import User
from django.views.generic import View
from django.contrib import messages
from django.template.loader import render_to_string
from django.utils.http import urlsafe_base64_decode, urlsafe_base64_encode
from .utils import TokenGenerator, generate_token
from django.utils.encoding import force_bytes, force_str, DjangoUnicodeDecodeError
from django.core.mail import EmailMessage
from django.conf import settings
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.tokens import PasswordResetTokenGenerator
70
def signup(request):
if request.method == 'POST':
email = request.POST['email']
password1 = request.POST['pass1']
password2 = request.POST['pass2']
if password1 != password2:
messages.warning(request, "Password not matching")
return render(request, 'signup.html')
else:
try:
if User.objects.get(username=email):
messages.info(request, "Email already exist")
return redirect('/auth/signup')
except Exception as e:
pass
email_msg = EmailMessage(
email_subject, message, settings.EMAIL_HOST_USER, [email])
email_msg.send()
71
messages.info(
request, "Please check your mail to activate the account ")
return redirect('/auth/login')
class ActivateAccountView(View):
def get(self, request, uidb64, token):
try:
uid = force_str(urlsafe_base64_decode(uidb64))
user = User.objects.get(pk=uid)
except Exception as e:
user = None
def handlelogin(request):
if request.method == 'POST':
username = request.POST['email']
password = request.POST['password']
user = authenticate(username=username, password=password)
def handlelogout(request):
messages.info(request, "Logged out Successfully")
logout(request)
return redirect('/auth/login')
class RequestResetEmailView(View):
def get(self, request):
return render(request, 'request-reset-email.html')
if user.exists():
# current_site=get_current_site(request)
email_subject = '[Reset Your Password]'
message = render_to_string('reset-user-password.html', {
'domain': '127.0.0.1:8000',
'uid': urlsafe_base64_encode(force_bytes(user[0].pk)),
'token': PasswordResetTokenGenerator().make_token(user[0])
})
print(message)
73
email_message = EmailMessage(
email_subject, message, settings.EMAIL_HOST_USER, [email])
email_message.send()
messages.info(
request, f"WE HAVE SENT YOU AN EMAIL WITH INSTRUCTIONS ON
HOW TO RESET THE PASSWORD {message} ")
return render(request, 'request-reset-email.html')
class SetNewPasswordView(View):
def get(self, request, uidb64, token):
context = {
'uidb64': uidb64,
'token': token
}
try:
user_id = force_str(urlsafe_base64_decode(uidb64))
user = User.objects.get(pk=user_id)
try:
user_id = force_str(urlsafe_base64_decode(uidb64))
user = User.objects.get(pk=user_id)
user.set_password(password)
user.save()
messages.success(
request, "Password Reset Success Please Login with NewPassword")
return redirect('/auth/login/')
ecommerece setting.py:-
"""
Django settings for ecommerce project.
import os
from pathlib import Path
from django.contrib import messages
ALLOWED_HOSTS = []
RAZORPAY_KEY_ID = 'rzp_test_rTNEOIsekkL69o'
RAZORPAY_KEY_SECRET = 'MbtzIL6vt2aYOFbKIOLL5Ny3'
EMAIL_HOST = 'smtp.gmail.com'
76
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'ovnd mtrv mrvo rzoc'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
# DEFAULT_FROM_EMAIL = 'noreply<[email protected]>'
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'ecommerceapp',
'authenticate',
]
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',
77
]
ROOT_URLCONF = 'ecommerce.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ["templates"],
'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/5.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
78
# Password validation
# https://docs.djangoproject.com/en/5.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/5.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_TZ = True
79
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.0/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
# Default primary key field type
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
MESSAGE_TAG = {
messages.ERROR: 'danger',
}
Order cancel.html :-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Redirecting...</title>
<style>
/* Optional: Add some CSS for styling */
body {
font-family: Arial, sans-serif;
80
background-color: #f0f0f0;
text-align: center;
padding-top: 100px;
}
h1 {
color: #333;
}
</style>
</head>
<body>
<h1>Your {{value}} has Succesfully send</h1>
<h1>Redirecting...</h1>
<p>You will be redirected to another page in a few seconds...</p>
<script>
// Redirect after 5 seconds
setTimeout(function() {
window.location.href = '/'; // Replace with the URL of the page you want to
redirect to
}, 5000); // 5000 milliseconds = 5 seconds
</script>
</body>
</html>
Order cheackout.html:-
{% extends 'base.html' %}
{% block title %}
Check Out
{% endblock title %}
{% block content %}
81
<h1>Welcome to Dhamaka Sale</h1>
{% endblock content %}
{% block body %}
{% load static %}
<div
class="alert alert-{{message.tags}} alert-dismissible fade show"
role="alert"
>
<strong>{{message}}</strong>
<button
type="button"
class="btn-close"
data-bs-dismiss="alert"
aria-label="Close"
></button>
</div>
{% endfor %}
<div class="section-title">
<h2>Welcome to Shop</h2>
<h3>Checkout Page </h3>
</div>
82
<div class="container">
<div class="col my-4">
<h2>Step 1 - My Awesome Cart Express Checkout - Review Your Cart
Items</h2>
<div class="my-4">
<ul class="list-group" id="items">
</ul>
<nav aria-label="breadcrumb">
<ol class="breadcrumb mt-3">
<li class="breadcrumb-item active" aria-current="page">Your Cart Total Is
<b>Rs. <span id="totalprice"></span> <span id="amount"></span></b>. Enter your
details below & place your order. Thanks for using Shopping Cart</li>
<li</li>
</ol>
</nav>
</div>
</div>
<div class="col my-4">
<h2>Step 2 - Enter Address & Other Details:</h2>
<form method="post" action="/checkout/">{% csrf_token %}
<input type="hidden" name="itemsJson" id="itemsJson">
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputAddress">Address</label>
<input type="text" class="form-control mt-3" id="address1"
name="address1" placeholder="1234 Main St" required>
</div>
<div class="form-group col-md-6">
<label for="inputAddress">Address line 2</label>
<input type="text" class="form-control mt-3" id="address2"
name="address2" placeholder="1234 Main St" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputCity">City</label>
84
<input type="text" class="form-control mt-3" id="city" name="city"
required>
</div>
<div class="form-group col-md-6">
<label for="inputState">State</label>
<input type="text" class="form-control mt-3" id="state" name="state"
placeholder="Enter State" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputZip">Pin Code</label>
<input type="number" class="form-control mt-3" id="zip_code"
name="zip_code" required>
</div>
<div class="form-group col-md-6">
<label for="inputZip">Phone Number</label>
<input type="number" class="form-control mt-3" id="phone"
name="phone" required>
</div>
<br>
<script src="https://code.jquery.com/jquery-3.3.1.js"
integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
85
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"
integrity="sha384-
wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"
integrity="sha384-
B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k"
crossorigin="anonymous"></script>
<script>
if (localStorage.getItem('cart') == null) {
var cart = {};
} else {
cart = JSON.parse(localStorage.getItem('cart'));
}
console.log(cart);
var sum = 0;
var totalPrice = 0;
if ($.isEmptyObject(cart)) {
//if object is empty
mystr = `<p>Your cart is empty, please add some items to your cart before checking
out!</p>`
$('#items').append(mystr);
} else {
for (item in cart) {
let name = cart[item][1];
let qty = cart[item][0];
let itemPrice = cart[item][2];
86
sum = sum + qty;
totalPrice = totalPrice + qty* itemPrice;
}
document.getElementById('totalprice').innerHTML = totalPrice;
$('#itemsJson').val(JSON.stringify(cart));
{% if thank %}
alert('Thanks for ordering with us. Your order is is {{id}}. Use it to track your order
using our order tracker');
localStorage.clear();
document.location = "/";
{% endif %}
87
{% endblock body %}
Signup.html:-
{% extends "base.html" %} {% block title %} SignUp {% endblock title %}
{% block content %}
<div class="card bg-transparent mt-5 px-5 p-1 border border-white">
<h2 class="text-light">Signup</h2>
89
CHAPTER 6
TESTING
6.1 INTRODUCTION TO SYSTEM TESTING:
90
4. Compatibility: Testing the website on different devices, browsers,
and operating systems to ensure that it is compatible and displays
correctly for all users.
5. Integration: Testing the integration of the website with external
systems, such as payment gateways, inventory management systems,
and shipping providers, to ensure that data is exchanged correctly and
transactions are processed smoothly.
6. Usability: Testing the usability of the website to ensure that it is easy
to navigate, intuitive to use, and meets the needs of users.
TYPES OF TESTING:
Unit Testing:
91
- Performance testing in ecommerce involves evaluating the speed,
responsiveness, and stability of an online store under various conditions. It
helps ensure that the website can handle a high volume of users and
transactions without slowdowns or crashes. Performance testing typically
includes load testing, stress testing, and scalability testing to identify and
address any bottlenecks or performance issues. By conducting performance
testing, ecommerce businesses can optimize their websites for better user
experience, reduce bounce rates, and improve overall customer satisfaction.
Security Testing:
Regression Testing:
Functional test:
Functional tests provide systematic demonstrations that functions tested are available
as specified by the business and technical requirements, system documentation, and user
manuals.
System Test:
93
System testing in ecommerce involves testing the entire ecommerce system,
including the website, databases, servers, and integrations, to ensure it
functions correctly. This includes testing functionality, performance under
various conditions, security, compatibility with different devices and
browsers, integration with external systems, and usability. The goal is to
identify and fix issues before the website is launched, ensuring a positive user
experience and reducing the risk of errors and downtime.
Acceptance Testing:
User Acceptance Testing is a critical phase of any project and requires
significant participation by the end user. It also ensures that the system meets
the functional requirements.
Description: Verify that the `Room` model is correctly created with the required fields.
Test Steps:
Expected Results: The `Room` object should have all the required fields (`code`,
Expected Results: A new room should be created in the database with the provided data.
Actual Results: The API endpoint successfully creates a new room in the database.
Test Steps:
Expected Results: The user should be redirected to the room page and successfully join the
room.
Actual Results: The user is redirected to the room page and can interact with the room's
features.
Description: Verifies the functionality of updating room details, including votes to skip and
guest can pause settings.
Preconditions:
Test Steps:
95
Click on the “setting” button.
Give inputs fields for updating the room, including votes to skip and guest can pause.
Expected Results: The host should be able to update the room details without encountering
any errors and a confirmation message should displayed to notify the host.
Actual Results: The host is able to update the room and a confirmation message “Room
Updated Successfully” is displayed.
Preconditions: A valid room exists with at least one song in the playlist.
Test Steps:
Expected Results: The song should start playing in the room's music player.
Actual Results: The song starts playing, and users in the room can hear it.
Description: Verify that the `Room` model correctly handles invalid input data.
Expected Results: The creation of the `Room` object should fail, and appropriate error
handling should be in place.
Actual Results: The creation fails when invalid data is provided, and the error is handled
properly.
96
TEST CASE ID: 007
Test Steps:
Expected Results: The method should return the details of the current song being played in
the room.
Actual Results: The method successfully retrieves the current song details.
Test Steps:
Expected Results: The user should be redirected to the homepage or a different page, and
their session in the room should be terminated.
Actual Results: The user is successfully removed from the room, and the session is
terminated.
Test Steps:
97
Expected Results: The current song should be skipped, and the next song in the playlist
should start playing.
Actual Results: The current song is skipped, and the next song starts playing as expected.
Description: Test the integration between the Spotify API and the application backend.
Test Steps:
Trigger an action in the application that interacts with the Spotify API, such as playing a
song.
Expected Results: The application successfully communicates with the Spotify API and
performs the desired action.
Actual Results: The action is executed, and the Spotify API responds appropriately.
These test cases cover various aspects of the project to ensure the robustness and reliability
of the application.
CHAPTER 7
SAMPLE SCREENSHOTS
98
HOME PAGE:
LOGIN PAGE:
99
SIGNUP PAGE:
100
LIST OF PRODUCTS:
101
CHEACKOUT:-
MY PROFILE:
102
103
CONTACTUS PAGE:-
ADMIN PAGE:-
104
PRODUCT ADD PAGE:-
105
RETURN REQUEST PAGE:-
8.CONCLUSION:
The music streaming application project has been a journey of innovation and
creativity, aiming to deliver a seamless and immersive listening experience to users
106
worldwide. As we conclude this project, it's essential to reflect on the
accomplishments, challenges faced, and the overall impact of the application.
Throughout the development process, our team worked tirelessly to bring the vision
of the application to life. We started with a clear understanding of the user needs and
market trends, which guided our decisions at every stage of development. From
designing the user interface to implementing complex backend functionalities, each
aspect of the application was crafted with precision and attention to detail.
One of the key achievements of this project is the successful implementation of core
features such as playlist management, playback controls, and integration with third-
party APIs like Spotify. These features not only enhance the user experience but also
differentiate the application from competitors in the crowded music streaming
market.
Moreover, the application's scalability and robustness were prioritized from the
outset, ensuring that it can handle a large user base and adapt to changing demands
over time. By leveraging modern technologies and best practices in software
development, we built a foundation that can support future growth and expansion.
However, the journey was not without its challenges. From technical hurdles to
tight deadlines, our team encountered various obstacles along the way. Yet, through
collaboration, perseverance, and innovative problem-solving, we overcame these
challenges and delivered a product that we are proud of.
One of the critical aspects of the project was testing and quality assurance. Rigorous
testing was conducted at every stage of development to identify and address
any issues promptly. Unit tests, integration tests, and system tests were carried out
meticulously to ensure that the application performs reliably across different devices
and platforms.
Looking ahead, there are opportunities for further enhancement and refinement of the
application. Future iterations could focus on introducing advanced features such as personalized
recommendations, social integration, and offline mode to enrich the user experience further.
Additionally, continuous updates and improvements will be essential to stay ahead of the
competition and meet evolving user expectations
107
FUTURE ENHANCEMENT
There are several areas where the music streaming application can be enhanced to
provide an even better user experience, stay competitive in the market, and meet
evolving user needs. Here are some potential future enhancements:
Social Features
Introduce social features that enable users to connect with friends, share playlists,
collaborate on playlists, and see what their friends are listening to. This could include
features such as following other users, liking and commenting on playlists, and creating
collaborative playlists.
User Profiles
Create user profiles that allow users to customize their experience, view their listening
history, manage their playlists, and see recommendations tailored to their preferences.
User profiles could also include social elements such as profile pictures, bios, and
follower counts.
108
Offline Mode
Enable users to download songs, albums, and playlists for offline listening, allowing
them to enjoy music even when they don't have
Lyrics Integration
Integrate lyrics into the application, allowing users to view lyrics while listening to songs.
This could enhance the listening experience and make it easier for users to singalong to
their favorite songs.
Expand the content library to include podcasts, audiobooks, and other spoken-word
content. This would appeal to users who are interested in a wider range of audio content
beyond music.
Partner with artists, labels, and event organizers to provide access to live events,
concerts, and exclusive performances through the application. This could include live
streams, virtual concerts, and ticket sales for in-person events.
Accessibility Features
109
and high contrast mode to make the application more inclusive and accessible to
userswith disabilities.
Integrate the application with smart devices such as smart speakers, smart TVs, and
wearables to provide a seamless and integrated listening experience across different
devices and platforms.
BIBLOGRAPHY
110