E Commerce

Download as pdf or txt
Download as pdf or txt
You are on page 1of 129

SEA

SEA of A
project
Computer
Devasandra College Department BACHELOR report
College
Ekta Application,
submitted
Nagar, Under during
Mai
University
Bengaluru
n North of of Amaljith m of
"E-Conmerce
Website"
Bangalore-560049.Road, Science,
Near KowLEDGE
Computer
L.SASIKALA SubmittedBy OF the sixth in
Science,
ASIST
AN the partial
COMPUTERacademic
Ayyappanagar
Vigronagar semester
SEAET Guidance
SUPRE13 EDUGATIO fulfillment
QUALIT Science
Commerce EoUCATION TRUSTR)
HROUGA yearunder
Post, R2013408 2022-2023.
Commerce
Circle, & APPLICATIONS
of Bengaluru the of
K.R.Puram, Applications
requirement
and
North
Arts
University for and
bachelor
Arts
a of in Computer Place:
Bangalore
is is
guidance Department Date:
O6-||-2023
Website",
which
Arts
of
Applications,
and of Bachelor
"E-Commerce
University
North
Bengaluru Under the
Commerce 2022-2023. of
of
(R2013408) A.
award Head & Circle,
&
HROUGH
aUALITY
DUCATE
ASIAN
ON

PREY
Certificate
Science
entitled
theUniversity

Commerce
Puram,
Nagar Bangalore
Principal
PRINCIPAL -560
049
K.R.
Science,
Ayyappa
Post,
Science, SEAE Computer
for
m
project Virgonagar
requirement
Amaljith of Ekthanagar,
sOUTHEA North College
the of SEA
of Bengaluru
that Department
by the
College certify
done of
fulfillment
from
to workL.SASIKALA
Guide VALUED
Internal RECORD
is Application Examiners:
SEA This
Bonfied
partial 1)
functioning support,
strength Asian Arts And
constant not
and
and prayers.
if
well-being
and East order. constant advices the
proper Commerce project.
her
project.South
knowledge, proper and
in
helped
for her
her Professor advice
of the this for our
this chairman
for Science,
in for gratitude for which
completeequipment'sruns UGof
wisdom, completion encouragement,
also
everythingof Assistant advice
of but
Acknowledgment
health,
the
and Krishnappa,
College
Department
sincere
studies and
adequate successful
,
start that L.Sasikala
our
blessings. SEA support, support
to sure the express our
able A. and of of
for
their
making
Principal
Lateinfrastructure the
Head only
guidance,
the are Mrs.
to We for
forwe contributed not
Almighty
the College the guideproject. need, sisters
that to the Theja, their
will gratitude N, our whole and
good T the for we project.
Santhito
greatly materials
Godhis providingGowda managing thanks
the
parents today. brothers
by sincere
thankonly P. which during here this
Muthe
Mrs. hearty our the ourof
to is our for in guidancesupport thank
be
all not thank completion
wantItus. express
Trust Dr.
effort thank our providing
institution.
the
of extend to will to
we to hanktireless
all,
given to Educational and andcorrections.
sincerely want we want
wish also alsoguidance alsofor them. also
Successful
Above
has his advice,
he We We for We We We also,for We
Contents

SL No. Topic Page No.

1. Abstract 5

2. Introduction 5

3. System Specification 7

4. Details of Software 8

5. System Study and Analysis 14

6. Modules 17

7. System Design 18

8. Database Design 25

9. Testing 28

10. Coding 30

11. Screenshots 125

12. Implementation 128

13. Conclusion 129

14. Bibliography 129


SEA College Of Science, Commerce and Art’s

ABSTRACT

The E-commerce website enables shoppers to place orders for products and services through an online
platform. This platform serves both in-store customers and online shoppers. The website displays a
comprehensive list of items available for purchase from the store. Through this online application, customers
can conveniently select their desired products and provide their personal information such as address and
contact details. The chosen products are then delivered to the customers' homes. Customers have the flexibility
to view their shopping cart anytime, and they can add, modify, or remove items as they prefer.

When a customer decides to finalize their purchase, they have the option to print a copy of their
shopping cart as a record. This web-based application offers significant time-saving benefits to customers and
enhances their overall shopping experience. The field of E-commerce has experienced substantial growth in
the last ten years. An important aspect of online retail is to provide relevant suggestions to users, streamlining
their decision-making process and reducing the time spent on browsing the website. Additionally, the ability
to create visual wishlists and reports adds to the appeal of these online platforms

INTRODUCTION
In the contemporary digital landscape, E-commerce websites have emerged as game-changers,
reshaping the way commerce is conducted. These online platforms have transcended geographical boundaries
and time constraints, allowing individuals and businesses to engage in buying and selling with unprecedented
ease and convenience.

At its core, an E-commerce website serves as a virtual marketplace where products and services of various
types are displayed, categorized, and made available for purchase. This digital storefront provides an extensive
catalog that spans industries, from electronics and fashion to groceries and digital services. Users can explore
a diverse range of options, compare prices, read reviews, and make informed purchasing decisions, all through
a user-friendly interface.

What truly sets E-commerce websites apart is their ability to bridge the gap between buyers and sellers,
regardless of their physical location. This global connectivity has democratized commerce, enabling even the
smallest of businesses to showcase their offerings to a worldwide audience. Moreover, consumers can shop at
any time of day or night, making transactions at their convenience and eliminating the need to adhere to
traditional store operating hours.

The impact of E-commerce websites extends far beyond convenience. For businesses, these platforms
represent a powerful avenue for growth. They can establish an online presence with significantly lower
overhead costs compared to physical stores. This reduced cost structure can lead to competitive pricing for
consumers and increased profit margins for businesses.

Additionally, E-commerce websites often employ sophisticated algorithms to provide personalized


recommendations and tailored shopping experiences. By analyzing user behavior and preferences, these
platforms suggest products that align with individual tastes, streamlining the decision-making process and
enhancing customer satisfaction.

In the realm of consumer behavior, E-commerce websites have contributed to a paradigm shift.
Shoppers now possess the ability to research, compare, and purchase items with unparalleled convenience.
This has

E-Commerce Website 5
SEA College Of Science, Commerce and Art’s

led to changes in traditional retail dynamics, prompting businesses to adapt and innovate to meet the evolving
demands of the digital-savvy consumer.

In conclusion, E-commerce websites have ushered in a new era of commerce, where borders are no
longer barriers and transactions occur at the speed of a click. These platforms have transformed the way
businesses operate and the way consumers shop, offering a dynamic and interconnected marketplace that
continues to reshape industries and shape the future of commerce.
DESCRIPTION

An E-commerce website is an online platform that revolutionizes the way businesses and consumers engage
in commerce. It acts as a virtual marketplace where businesses showcase their products and services, and
customers can explore, select, and purchase items with ease. These websites offer a dynamic shopping
experience, featuring user-friendly interfaces, comprehensive product details, secure payment options, and
convenient checkout processes. They enable users to create personalized accounts, track orders, and receive
tailored recommendations based on their preferences. E-commerce websites have reshaped the retail landscape
by providing a borderless, 24/7 shopping environment that caters to a global audience, making transactions
more accessible and efficient than ever before.

PURPOSE
An E-commerce website attempts to enhance admittance to care and improve the continuousness and
good organization of services. Depending on the particular setting and local case executives are responsible
for a diversity of tasks, position from linking clients to the services to really providing intensive shop and
delivery facilities themselves.

MAIN OBJECTIVES

• Facilitate Online Transactions: E-commerce websites are designed to enable smooth and secure
online transactions, allowing customers to browse, select, and purchase products or services with ease.

• Expand Market Reach: The digital nature of E-commerce websites breaks down geographical
barriers, enabling businesses to reach a wider audience beyond their physical location and tap into
global markets.

• Enhance Convenience: E-commerce websites offer the convenience of 24/7 shopping, allowing
customers to browse and buy products at their preferred times, fitting seamlessly into their schedules.

• Provide Product Information: E-commerce platforms present detailed product information, images,
specifications, and customer reviews, empowering customers to make informed purchasing decisions.

• Personalize Shopping Experience: By analyzing user behavior and preferences, E-commerce


websites can provide personalized product recommendations, improving customer satisfaction and
encouraging repeat business.

• Optimize Inventory Management: E-commerce platforms assist businesses in efficient inventory


management by tracking product availability, automating stock updates, and minimizing overstock or
stockouts.

E-Commerce Website 6
SEA College Of Science, Commerce and Art’s

• Secure Payment Processing: E-commerce websites prioritize secure payment gateways, protecting
sensitive financial information and instilling customer trust in online transactions.

• Build Customer Relationships: Through user accounts, order history, and personalized
communication, E-commerce websites foster customer loyalty and engagement, leading to long-term
relationships.

• Boost Sales and Revenue: E-commerce platforms offer businesses the potential to increase sales and
revenue by providing a new channel for customer acquisition and driving more frequent transactions.

• Monitor Performance: E-commerce websites enable businesses to track sales metrics, user behavior,
and website performance, allowing them to refine strategies and make data-driven decisions.

• Adapt to Changing Trends: E-commerce websites can quickly adapt to changing market trends,
incorporating new products or services and adjusting strategies to align with consumer preferences.

• Improve User Experience: A user-friendly interface, easy navigation, and responsive design
contribute to a positive user experience, enhancing customer satisfaction and retention.

SYSTEM SPECIFICATION

• Hardware Requirements Specification: -

• Processor: i5, 10th Gen Intel Core, the speed of 2.50 GHz.
• RAM: 8 GB.
• ROM: 512 GB HDD.
• Monitor: Standard Colour Monitor, 16.1 inch.
• Key Board: Standard Keyboard.
• Mouse: Standard Mouse.

• Software Requirements Specification: -

• Language Used : Python

• Database : SQL

• User Interface Design : HTML, JavaScript ,CSS

• Web Browser : Google Chrome, Microsoft Edge, OPERA etc.

E-Commerce Website 7
SEA College Of Science, Commerce and Art’s

DETAILS OF SOFTWARES
OVERVIEW OF TECHNOLOGIES USED

Front End Technology :


ABOUT PYTHON

Python is a high-level programming language known for its simplicity, readability, and versatility. Created
by Guido van Rossum and first released in 1991, Python has gained immense popularity due to its user-
friendly syntax and extensive standard library. It is widely used in various fields such as web development,
data analysis, scientific computing, artificial intelligence, and more.

Key features that make Python stand out include:

• Readable and Elegant Syntax: Python's syntax is designed to be easy to read and write. The use of
indentation (whitespace) for code blocks enhances code readability and enforces a consistent style across
projects.

• Interpreted and Interactive: Python is an interpreted language, which means that code is executed line by
line by an interpreter rather than being compiled beforehand. This allows for quick experimentation and
interactive development using tools like the Python interpreter or Jupyter notebooks.

• Extensive Standard Library: Python comes with a comprehensive standard library that provides modules
and functions for a wide range of tasks, from file I/O and networking to data manipulation and regular
expressions. This reduces the need to build everything from scratch.

• Cross-Platform Compatibility: Python is available on various operating systems, including Windows,


macOS, and Linux, making it easy to develop and deploy code across different platforms.

• Large and Active Community: Python has a vast and active community of developers, which means
there's a wealth of documentation, tutorials, libraries, and frameworks available. This community support
can greatly aid in learning and problem-solving.

• Versatility: Python can be used for a wide array of applications. It's utilized in web development (using
frameworks like Django and Flask), data analysis (with libraries like pandas and NumPy), scientific
computing (using tools like SciPy), machine learning and artificial intelligence (with TensorFlow, PyTorch,
and scikit-learn), and more.

E-Commerce Website 8
SEA College Of Science, Commerce and Art’s

•Open Source: Python is open source, meaning its source code is freely available for anyone to view, use,
modify, and distribute. This fosters collaboration and innovation within the developer community.

• Dynamic Typing: Python is dynamically typed, meaning variable types are determined at runtime. This
allows for more flexible and expressive code but also requires careful consideration to prevent type-related
errors.

• Object-Oriented: Python is an object-oriented language, which means it supports the principles of


encapsulation, inheritance, and polymorphism, making it suitable for building complex software systems.

•Third-Party Libraries and Packages: The Python Package Index (PyPI) hosts an enormous collection of
third-party libraries and packages, which further extend Python's capabilities. Developers can easily install
and use these packages using package managers like pip

Introduction to HTML

The Hypertext Markup Language (HTML) is a simple markup language. Used to create a hypertext
document that are portable from one platform to another HTML documents are SGML (Standard generalized
markup language) documents with generic semantics that are appropriate for representing information from a
wide range of applications. This specification defines HTML version 3.2. HTML 3.2 aims to capture
recommended practice as of early '96 and as such a replacement for HTML2.0 (RFC 1866).
A set of instructions embedded in a document is called markup language. These instructions describe
what the document text means and how it should look like in a display. Hyper Text Mark Up language (HTML)
is the language used to encode World Wide Web documents.
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 called opening tags and closing tags).
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.

HTML LAYOUT:

An HTML document consists of text, which comprises the content of the document and tags, which
defines the structure and appearance of the document. The structure of an HTML document is simple, consists
of outer.

<HTML> tag enclosing the document header and body.


<HTML>
<HEAD>
<TITLE>the title of html document</TITLE>
</HEAD>
<BODY>

E-Commerce Website 9
SEA College Of Science, Commerce and Art’s

This is where the actual HTML documents Text lies, which is displayed in the browser
</BODY>
</HTML>

Each document has a head and body delimited by the<HEAD> and<BODY> tag. The head is where
you give your HTML document a title and where you indicate other parameters the browser may use when
displayed the document. This includes the text for displaying the text. Tag also references special and indicates
the hot spots that link your document to another document.

Introduction of JavaScript:

JavaScript is a new scripting language for Webpages. Scripts written with JavaScript can be embedded
into your HTML pages. With java script you have many possibilities for enhancing your HTML page with
interesting elements. For example, you are able to respond to user-initiated events quite easily. Some effects
that are now possible with java script were sometimes ago only possible with CGI. So, you can create really
sophisticated pages with the help of java script on the Internet.

How can Java Script scripts run?

The first browser to support java script was the Netscape Navigator 2.0 of course the higher versions
do have java script as well You might know that java does not run on all Netscape Navigators 2.0 (or higher
versions) versions. But this is not true for java script although there are some problems with the different
versions.

The mac version for example seems to have many bugs. In the near future there are going to be some
other browsers, which support java script. The Microsoft internet explorer 3.0 is going to support java script.
Java script enabled browsers are going to spread soon- it is worth learning this new technique now. You might
realize that is really easy to write Java Script scripts. We have to know some basic techniques and some work-
around for problems you might encounter an HTML document.

<html>
<head>
My first JavaScript
</head>
<body><br>
This is a normal HTML document <br>
<script language="JavaScript> Document. Write (“this is a java script”)
</script><br> Backing HTML again
</body>
</html>
Introduction to CSS

CSS, or Cascading Style Sheets, is a stylesheet language used to describe the presentation and visual design
of web pages written in HTML (Hypertext Markup Language). In web development, HTML defines the
structure and content of a webpage, while CSS determines how that content should be styled, positioned, and
visually presented to users.

CSS serves several essential functions:

E-Commerce Website 10
SEA College Of Science, Commerce and Art’s

• Styling Elements: CSS is primarily responsible for styling various elements on a webpage, such as
fonts, colors, backgrounds, margins, padding, borders, and more. It allows web developers to control
the visual appearance of these elements to create a cohesive and visually appealing design.

• Layout Control: CSS provides layout control by positioning elements on a webpage, specifying their
dimensions, and arranging them in columns, grids, or other layout structures. This ensures a consistent
and organized design across different devices and screen sizes.

• Responsive Design: With CSS, web developers can create responsive designs that adapt to different
screen sizes, from desktop monitors to mobile devices. This is achieved through techniques like media
queries, which adjust the styling based on the user's device characteristics.

• Typography: CSS enables precise control over text formatting, such as font type, size, line height,
letter spacing, and text alignment. This ensures a visually appealing and readable presentation of
textual content.

• Animations and Transitions: CSS allows the creation of animations and transitions to add dynamic
and interactive elements to web pages. This includes effects like fades, slides, rotations, and more,
enhancing the user experience.

• Flexibility: By using classes and IDs, CSS offers flexibility in applying styles selectively to specific
elements, ensuring consistent design patterns across a website.

• Separation of Concerns: One of the fundamental principles of web development is the separation of
concerns. CSS facilitates this by separating the content (HTML) from the presentation (CSS), making
code maintenance and updates more efficient.

CSS operates on the concept of cascading, where multiple styles can be applied to the same HTML element.
Styles are applied based on specificity and order of appearance, allowing for a hierarchical approach to styling.

To implement CSS in a webpage, developers use various selectors to target HTML elements, and then apply
property-value pairs to define the desired styles. For example:

```css
/* Selects all <h1> elements and sets their color to blue */
h1 {
color: blue;
}

/* Selects elements with class "button" and styles them */


.button {
background-color: #007bff;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
}

E-Commerce Website 11
SEA College Of Science, Commerce and Art’s

/* Selects elements with ID "header" and sets the font size */


#header {
font-size: 24px;
}
```

In summary, CSS is a fundamental technology in web development that enables designers and developers to
control the visual appearance of web pages, create appealing layouts, and enhance the user experience through
styling and presentation.

Back End Technology:


ABOUT SQL

SQL Introduction

MySQL is an open-source relational database management system that works on many platforms. It
provides multi-user access to support many storage engines and is backed by Oracle. So, you can buy a
commercial license version from Oracle to get premium support services.

Database Management System & Types of DBMS

A Database Management System (DBMS) is a software application that interacts with the user,
applications and the database itself to capture and analyze data. The data stored in the database can be
modified, retrieved and deleted, and can be of any type like strings, numbers, images etc.

Types of DBMS
There are mainly 4 types of DBMS, which are Hierarchical, Relational, Network, and Object-Oriented
DBMS.

• Hierarchical DBMS: As the name suggests, this type of DBMS has a style of predecessorsuccessor type
of relationship. So, it has a structure similar to that of a tree, wherein the nodes represent records and the
branches of the tree represent fields.
• Relational DBMS (RDBMS): This type of DBMS, uses a structure that allows the users to identify and
access data in relation to another piece of data in the database.
• Network DBMS: This type of DBMS supports many to many relations wherein multiple member records
can be linked.
• Object-oriented DBMS: This type of DBMS uses small individual software called objects. Each object
contains a piece of data, and the instructions for the actions to be done with the data.

Types of SQL Commands:

E-Commerce Website 12
SEA College Of Science, Commerce and Art’s

• DDL (Data Definition Language) – It allows you to perform various operations on the database such as
CREATE, ALTER and DELETE objects.
• DML (Data Manipulation Language) – It allows you to access and manipulate data. It helps you to insert,
update, delete and retrieve data from the database.
• DCL (Data Control Language) – It allows you to control access to the database. Example – Grant or
Revoke access permissions.
• TCL (Transaction Control Language) – It allows you to deal with the transaction of the database. Example
– Commit, Rollback, save point, Set Transaction.

SQL Data Types:

• Numeric – This data type includes integers of various sizes, floating- point(real) of various precisions and
formatted numbers.

• Character-string – These data types either have a fixed, or a varying number of characters. This data
type also has a variable-length string called CHARACTER LARGE OBJECT (CLOB) which is
used to specify columns that have large text values.

E-Commerce Website 13
SEA College Of Science, Commerce and Art’s

• Bit-string – These data types are either of a fixed length or varying length of bits. There is also a variable-
length bit string data type called BINARY LARGE OBJECT(BLOB), which is available to specify
columns that have large binary values, such as images.

• Boolean – This data type has TRUE or FALSE values. Since SQL, has NULL values, a three-valued logic
is used, which is UNKNOWN.

• Date & Time – The DATE data type has: YEAR, MONTH, and DAY in the form YYYYMM-DD.
Similarly, the TIME data type has the components HOUR, MINUTE, and SECOND in the form HH:MM:
SS. These formats can change based on the requirement.

• Timestamp & Interval – The TIMESTAMP data type includes a minimum of six positions, for decimal
fractions of seconds and an optional WITH TIME ZONE qualifier in addition to the DATE and TIME
fields. The INTERVAL data type mentions a relative value that can be used to increment or decrement an
absolute value of a date, time, or timestamp.

Python SQL Connectivity:

Host (server name) ---Either a hostname (server name) or an IP address.


Username ---The SQL user name.
Password ---the Password to log in with.
Dbname ---Optional, the database to be used when performing queries.

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}

SYSTEM STUDY AND ANALYSIS

System analysis is a process of gathering and interpreting facts, diagnosing problems and the
information to recommend improvements on the system. It is a problem-solving activity that requires intensive
communication between the system users and system developers. System analysis or study is an important
phase of any system development process. The system is studied to the minutest detail and analyzed. The
system analyst plays the role of the interrogator and dwells deep into the working of the present system. The
system is viewed as a whole and the input to the systems are identified.

The data collected by these sources must be scrutinized to arrive to a conclusion. The conclusion is an
understanding of how the system functions. This system is called the existing system. Now the existing system
is subjected to close study and problems areas are identified. The designer now functions as a problem solver
and tries to sort out the difficulties that the enterprise faces. The solutionsare given as proposals. The proposal
is then weighed with the existing system analytically and the best one is selected. The proposal is reviewed on
user request and suitable changes are made. This is loop that ends as soon as the user is satisfiedwith proposal.
It does various feasibility studies.

E-Commerce Website 14
SEA College Of Science, Commerce and Art’s

In these studies, a rough figure of the system activities can be obtained, from which the decision about
the strategies to be followed for effective system study and analysis can be taken.

There are some important modules in the purpose system, which are:

 Login for admin: This module will allow the administrator to enter their respective forms.

 Login for user: This module will allow the user to view their profile and check for the updation.

EXISTING SYSTEM
In E-commerce website if we take the current system and compare with the proposed it is far behind.
Every work in the existing is manual and done on the paper. There might be a computer used somewhere
for the work but it’s is not doing exactly it’s is supposed which is reducing the manual work. Entering
everything manually to the computer by creating a file is not exactly we are talking in computerization.

The existing system requires a lot of manual work which results in taking more time than it should.
The operations like updating and synchronizing data are also done manually in the existing system that is
not automated and again time-consuming process. These practices are not at all reliable as the one wrong
entry can take a lot of time in detection and then there is a correction. Humans are prone to errors and can
mistakes often unless it has
some inbuilt programs which can take check the input and save from error Some major drawbacks of the
existing system:
1. Required a lot of paperwork and the process takes time.
2. Everything is done on the paper and these are highly prone to damages and requires a good amount of
security and space to store.
3. Required Buying of goods more frequent as compared to online system e.g.: paper, pen.
4. Likely to have an error.

PROPOSED SYSTEM
In E-commerce website after the planning and analysis phase of the system gets completed. Then the
next phase required to transform the collected required system information into structural blueprint which
will serve as a reference while constructing the working system.

It is a phase when most of the risks and errors unveiled so it’s is good practice to take care of this thing
from the start.

This will be a completely fledged system which can be the backbone of the whereas management of
the gymnasium therefore ignoring the chance or error isn't associated possibility as later it can create a
larger style of itself. So, it is better to minimize the problems faced by both staff and the manager in the
Organization.

ADVANTAGES OF THE PROPOSED SYSTEM

E-Commerce Website 15
SEA College Of Science, Commerce and Art’s

1. The projected system is very secured, as a result of for login the system it needs the username and
watchword that is completely different for every department thus providing each department a special read
of the member data.
2. It provides a wide selection of sure criteria in every window the shopper is functioning for higher and
faster answer.
3. Manages member data individually for all exercise and worker data individually for considering the wants
of gymnasium.
4. Stores data regarding regular machines.
5. This technique will run on any windows software package.
FEASIBILITY STUDY
After responsibility the plan E-commerce website, study and investigating all the current or
compulsory functionalities of the organization, the next job is to do the viability study for the project. All
plans feasible – given limitless resources and immeasurable time.
All the conceivable ways to deliver a solution to the given problem are find by feasibility study. This
planned answer would please all the workers need and must be flexible plenty so that future vicissitudes
can be simply done founded on the future imminent supplies.
A feasibility study of a system proposal is according to its workability, which is the impact on the
organization’s ability to meet their user needs and effective use of resources, thus when a new application
is proposed it normally goes through a feasibility study before it is approved for development. Different
tests of feasibility are studied during the investigation.

The main of them are-

• Technical feasibility
• Economic feasibility
• Operational feasibility
• Physical feasibility

 TECHNICAL FEASIBILITY

This is considered with specifying equipment and software that will successfully satisfy the user
requirement. It involves determining whether or not a system can actually be constructed or upgraded to solve
the problem at hand. The technical needs of a system may vary considerably, but might include and following:

1. The necessary technology of both hardware and software existed and also could be acquired for the
new system.
2. As the improvement in storage technology has developed over the recent years, data storage is
becoming easier and safer.
3. The new system with powerful database technology has the capability to hold the proposed data.
4. Technically, the system is designed in such a way that is provides accuracy, reliability, easy access, data
security and integrity.

 ECONOMIC FEASIBILITY

Economic feasibility involves estimating benefits and costs. These benefits and costs may be tangible
or intangible. It is seen whether the expenditure incurred for developing the new system will be cost effective
or not. Because of the confusion between the types of costs, it is sometimes very difficult to decide if the

E-Commerce Website 16
SEA College Of Science, Commerce and Art’s

benefits outweigh the costs. The basically involves top-level management of the company who are the decision
makers. Some key fin dings from the study are listed below.

1. There was no extra cost burden to conduct full systems investigation.


2. Basic hardware and software would ensure the smooth run of the application, as the necessary tools
were easily available.
3. The benefits are in the form of reduced costs with merely many errors, thus -reducing the manual work.
4. If the system were used without any major changes to it, no extra costs would be incurred.

 OPERATIONAL FEASIBILITY

Operational feasibility deals with the human aspects of the organization, proposed projects are
beneficial only if they can be turned into information systems that will meet the organization’s operating
requirements. This feasibility test asks whether the system will work when developed and installed, the users
need to be convinced about the advantages of the new system.

 PHYSICAL FEASIBILITY

It involves study to establish the time responses of the new system being created. For
e.g., if the new system takes more than one day to prepare crucial finance statement for the management,
wherever it was required in an hour, the system fails to provide the same.
It should be clearly established that the new system requirements in the form of time responses would be
completely met with. It may call for increase in cost. If the required cost is sacrificed then the purpose of the
new system may not be achieved even if it was found to be technically feasible.

MODULES
MODULES: This project contains 2 modules, those are

• Admin
• User

MODULES DESCRIPTION:

 Admin: -
• Home: In this section, Admin can see total orders, pending orders, total products, total users,
and messages.
• Products: In this section, admin can manage the products like add the products and remove
or delete the products.
• Order: In this section, admin can manage the orders where users placed orders.
• Users: In this section admin can manage the all accounts.
• Message: In this section, admin can see the all message which users send the feedback.

Admin can also update his profile, change the password and recover the password.

 User: -
• Home: In this section, User can see the products.

E-Commerce Website 17
SEA College Of Science, Commerce and Art’s

• Shop: In this section, User can add the products into the Cart or Wishlist the user can order
the products.
• Order: In this section user can see the order details.
• About: In this section user can see about grocery store.
• Feedback: In this section User can give feedback to the admin.

User can also update his profile, change the password and recover the password.

SYSTEM DESIGN

Design is the first step in the development phase for any techniques and principles for
the purpose of defining a device, a process, or a system in sufficient detail to permit its physical
realization.
Once the software requirements have been analysed and specified the software design
involves three technical activities - design, coding, implementation, and testing that are
required to build and verify the software.
The design activities are of main importance in this phase because in this activity,
decisions ultimately affecting the success of the software implementation and its ease of
maintenance are made. These decisions have the final bearing upon the reliability and
maintainability of the system. Design is the only way to accurately translate the customer’s
requirements into finished software or a system.
Design is the place where quality is fostered in development. Software design is a
process through which requirements are translated into a representation of software. Software
design is conducted in two steps.
Preliminary design is concerned with the transformation of requirements into data

USECASE DIAGRAM:

A Use case is a description of set of sequence of actions. Graphically it is rendered as


an ellipse with solid line including only its name. Use case diagram is a behavioural diagram
that shows a set of use cases and actors and their relationship. It is an association between that
use cases and actors. An actor represents a real-world object. Primary Actor-Sender, Secondary
ActorReceiver

 The purpose it to show the interactions between the use case and actor.

 To represent the system requirements from user’s perspective.


 An actor could be the end-user of the system or an external system.

E-Commerce Website 18
SEA College Of Science, Commerce and Art’s

Use case Diagram for User:

Use case Diagram for Admin:

DATA FLOW DIAGRAM

E-Commerce Website 19
SEA College Of Science, Commerce and Art’s

Data Flow Diagrams:

A Data Flow Diagram (DFD) is a traditional visual representation of the information flows within a
system. A neat and clear DFD can depict the right amount of the system requirement graphically. It can be
manual, automated, or a combination of both.

It shows how data enters and leaves the system, what changes the information, and where data is stored.

The objective of a DFD is to show the scope and boundaries of a system as a whole. It may be used as
a communication tool between a system analyst and any person who plays a part in the order that acts as a
starting point for redesigning a system. The DFD is also called as a data flow graph or bubble chart.

The following observations about DFDs are essential:

1. All names should be unique. This makes it easier to refer to elements in the DFD.

2. Remember that DFD is not a flow chart. Arrows is a flow chart that represents the order of events;
arrows in DFD represent flowing data. A DFD does not involve any order of events.

3. Suppress logical decisions. If we ever have the urge to draw a diamond- shaped box in a DFD, suppress
that urge! A diamond-shaped box is used in flow charts to represents decision points with multiple exists
paths of which the only one is taken. This implies an ordering of events, which makes no sense in a
DFD.

4. Do not become bogged down with details. Defer error conditions and error handling until the end of
the analysis.

Standard symbols for DFDs are derived from the electric circuit diagram analysis and are shown in fig:

E-Commerce Website 20
SEA College Of Science, Commerce and Art’s

Circle: A circle (bubble) shows a process that transforms data inputs into data outputs.

Data Flow: A curved line shows the flow of data into or out of a process or data store.

Data Store: A set of parallel lines shows a place for the collection of data items. A data store indicates that the
data is stored which can be used at a later stage or by the other processes in a different order. The data store
can have an element or group of elements.

Source or Sink: Source or Sink is an external entity and acts as a source of system inputs or sink of system
outputs.
Zero Level DFD:

E-commerce
website

First Level DFD:


Admin:

E-Commerce Website 21
SEA College Of Science, Commerce and Art’s

User:

ENTITY-RELATIONSHIP Diagrams
E-R (Entity-Relationship) Diagram is used to represents the relationship between entities in the table.

The Entity-Relationship model was originally proposed by Peter In 1976 (Chen76) as a way to unify
the network and relational database views. Simply, stated the ER model is a conceptual data model that mews
the real world as and relationship. A basic component of the model is the Entity-Relationship diagram which
is used

E-Commerce Website 22
SEA College Of Science, Commerce and Art’s

to visually represents data objects. Since Chen wrote his paper the model has been extended and today it is
commonly used for database design for the database designer, the utility of the ER model is:

• It maps well to the relational model. The constructs used in the ER model can easily be transformed into
relational tables.
• It is simple and easy to understand with a minimum of training. Therefore, the model can be used by the
database designer to communicate the design to the end user
• In addition, the model can be used as a design plan by the database developer to implement a data model
in a specific database management software.

ER Notation
There is no standard for representing data objects in ER diagrams. Each modeling methodology uses
its own notation. The original notation used by Chen is widely used in academic texts and journals but rarely
seen in either CASE tools or publications by nonacademics. Today, there are a number of notations used,
among the more common are Bachman, crow’s foot, and IDEFIX.

All notational styles represent entities as rectangular boxes and relationships as lines connecting boxes.
Each style uses a special set of symbols to represent the cardinality of a connection. The notation used in this
document is from Martin e symbols used for the basic ER constructs are:

• entities are represented by labelled rectangles. The label is the name of the entity. Entity names should be
singular nouns.

• relationships are represented by a solid line connecting two entities. The name of the relationship is written
above the line. Relationship names, should be verbs.

• Entity- this represents the name of an object, person, thing, event, or place where data is stored. This is
usually represented by rectangles.
• Weak Entity- unlike a strong entity that is defined by its attributes, a weak entity solely depends on the
existence of another entity.

E-Commerce Website 23
SEA College Of Science, Commerce and Art’s

• Attribute- refers to the unique characteristic or property of an entity.

• Derived Attribute- refers to an attribute derived or based on another attribute.

• Multivalued Attribute- a type of attribute that can have multiple values.

• Relationship- defines the interaction between two entities.

• Cardinality- this refers to the occurrences of a relationship. In particular, it specifies the maximum
number of relationships between two entities.

• Ordinality- describes whether a relationship is mandatory or optional. It is also used to determine the
absolute minimum number of relationships.

E-Commerce Website 24
SEA College Of Science, Commerce and Art’s

ER DIAGRAM:

Database Design

The data in the system has to be stored and retrieved from the database. Designing the database is part
of system design. Data elements and data structures to be stored have been identified at the analysis stage.
They are structured and put together to design the data storage and retrieval system.
A database is a collection of interrelated data stored with minimum redundancy to serve many users
quickly and efficiently. The general objective is to make database access easy, quick, inexpensive and flexible
for the user. Relationships are established between the data items and unnecessary data items are removed.
Normalization is done to get an internal consistency of data and to have minimum redundancy and maximum
stability. This ensures minimizing data storage required, minimizing chances of data inconsistencies and
optimizing for updates. The MySQL database has been chosen for developing the relevant databases.

E-Commerce Website 25
SEA College Of Science, Commerce and Art’s

E-commerce website Contains SQL Tables:

E-Commerce Website 26
SEA College Of Science, Commerce and Art’s

E-Commerce Website 27
SEA College Of Science, Commerce and Art’s

Class Diagram:
The class diagram shows a set of classes, interfaces, collaborations and their relationships.

TESTING
Introduction to Testing:
Software testing is an investigation conducted to provide stakeholders with information about the
quality of the software product or service under test. Software testing can also provide an objective,
independent view of the software to allow the business to appreciate and understand the risks of software
implementation. Test techniques include the process of executing a program or application with the intent of
finding software bugs (errors or other defects), and verifying that the software product is fit for use. Software
testing involves the execution of a software component or system component to evaluate one or more
properties of interest.

Test Plan
A test plan implies a series of desired course of action to be followed in accomplishing various testing
methods. The test plan acts as a blue print for the action that is to followed. The software engineers create a
computer program, its documentation and related data structures. The software developers is always
responsible for testing the individual units of the programs, ensuring that each platforms the function for which
it was designed. There is an independent test group (ITG) which is to remove the inherent problems associated
with letting the builder to test the thing that has been built.

The levels of testing include:


1. Unit testing

E-Commerce Website 28
SEA College Of Science, Commerce and Art’s

2. Integration testing

3. Acceptance testing

Unit Testing:

The first level of testing is called unit testing. Here different modules are tested against the
specifications produced during the design of the modules. Unit testing is done to test the working of individual
modules with test oracles.
Unit testing comprises a set of tests performed by an individual programmer prior to the integration of the
units into a large system. A system unit is usually small enough that the programmer who developed it can test
it in a great detail. Unit testing focuses first the modules to locate errors. These errors are verified and corrected
so that the unit perfectly fits to the project.
In our project E-commerce website, the code is divided into many units. We have used divide and conquer
technique. Each unit is separated and tested according to the user comfort. There is a line separating after each
part of the coding. It is easier to correct the errors.

Integration Testing:
The next level of testing is called the Integration Testing. In this many tested modules are combined
into subsystems, which were then tested.
Test case data is prepared to check the control flow of all the modules and to exhaust all possible inputs
to the program. Situations like treating the modules where there is no data entered in the next box are also
tested.
This testing strategy dictates the order in which modules must be available,and exerts strong influence
on the order in which the modules must be written. Debugged and unit tested. In Integration testing, all the
modules/units on which unit testing is performed are integrated together and tested.
In any project, there are different modules or subsystems. These subsystems are tested and combined
together or integrated together to form a bigger module or sometimes a whole system. This is done by
integration testing.

Acceptance Testing:
This testing is performed finally by user to demonstrate that the implemented system satisfies its
requirements. The user gives various inputs to get required outputs.
In our project, we have designed it in a way where any form of people can understand and use it.

Types of Testing
The general testing process is the creation of a testing strategy (which sometimes includes the
execution of the testing case), creation of a test plan/design (which usually includes test case and test
procedure) and the execution of tests. Test are inputs that have been devised to test the system.
1. Black-Box Testing
2. White Box Testing

3. Alpha Testing

4. Beta Testing

E-Commerce Website 29
SEA College Of Science, Commerce and Art’s

1) Black-Box Testing: -
Black box Testing is a software testing method in which the internal structure/design/implementation
of the item being tested is not known to the tester. These tests can be functional or non-functional. It focuses
on the functional requirements of the software. In black-box testing, the cases are derived from the
specification of the system, the implementation details of the system are not taken into considerations.

2) White Box Testing: -


White-box testing, is sometimes called Glass box testing or structural testing or clear box testing. White
box testing is used to test areas that cannot be reached from a black box testing. White-box texting user an
internal perspective of the system to design the test cases based on the internal structure.

3) Alpha Testing: -
Alpha testing is simulated for actual operational testing by potential users/customers or an independent
test team at the developer’s site. Alpha testing is often employed for off-theself software as a form of internal
acceptance testing before the software goes to beta testing.

4) Beta Testing: -
Beta testing comes after alpha testing. Version of the software, known as beta versions, is related to a
limited audience outside of the programming team. The software is released to groups of people so that further
testing can ensure the product has few faults or bugs.

CODING
Settings.json
{
"cSpell.words": [
"Arti",
"ASGI",
"njvmt",
"uidb"
]
}
Accounts
"""
ASGI config for ArtiZan project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see


https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ArtiZan.settings')

application = get_asgi_application()

from django.apps import AppConfig

class AccountsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'accounts'
from django import forms
from .models import Account, UserProfile

class RegistrationForm(forms.ModelForm):

E-Commerce Website 30
SEA College Of Science, Commerce and Art’s

password = forms.CharField(widget=forms.PasswordInput(attrs={
'placeholder': 'Enter Password',
'class': 'form-control',
}))
confirm_password = forms.CharField(widget=forms.PasswordInput(attrs={
'placeholder': 'Confirm Password'
}))

class Meta:
model = Account
fields = ['first_name', 'last_name', 'phone_number', 'email', 'password']

def clean(self):
cleaned_data = super(RegistrationForm, self).clean()
password = cleaned_data.get('password')
confirm_password = cleaned_data.get('confirm_password')

if password != confirm_password:
raise forms.ValidationError(
"Password does not match!
)

def __init__(self, *args, **kwargs):


super(RegistrationForm, self).__init__(*args, **kwargs)
self.fields['first_name'].widget.attrs['placeholder'] = 'Enter First Name'
self.fields['last_name'].widget.attrs['placeholder'] = 'Enter last Name'
self.fields['phone_number'].widget.attrs['placeholder'] = 'Enter Phone Number'
self.fields['email'].widget.attrs['placeholder'] = 'Enter Email Address'
for field in self.fields:
self.fields[field].widget.attrs['class'] = 'form-control'

class UserForm(forms.ModelForm):
class Meta:
model = Account
fields = ('first_name', 'last_name', 'phone_number')

def __init__(self, *args, **kwargs):


super(UserForm, self).__init__(*args, **kwargs)
for field in self.fields:
self.fields[field].widget.attrs['class'] = 'form-control'

class UserProfileForm(forms.ModelForm):
# image link path hiding
profile_picture = forms.ImageField(required=False, error_messages = {'invalid':("Image files
only")}, widget=forms.FileInput)
class Meta:
model = UserProfile
fields = ('address_line_1', 'address_line_2', 'city', 'state', 'country',
'profile_picture')

def __init__(self, *args, **kwargs):


super(UserProfileForm, self).__init__(*args, **kwargs)
for field in self.fields:
self.fields[field].widget.attrs['class'] = 'form-control'
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager

# Create your models here.

class MyAccountManager(BaseUserManager):
def create_user(self, first_name, last_name, username, email, password=None):
if not email:
raise ValueError('User must have an email address')

if not username:
raise ValueError('User must have an username')

user = self.model(
email = self.normalize_email(email),
username = username,
first_name = first_name,
last_name = last_name,
)

E-Commerce Website 31
SEA College Of Science, Commerce and Art’s

user.set_password(password)
user.save(using=self._db)
return user

def create_superuser(self, first_name, last_name, email, username, password):


user = self.create_user(
email = self.normalize_email(email),
username = username,
password = password,
first_name = first_name,
last_name = last_name,
)
user.is_admin = True
user.is_active = True
user.is_staff = True
user.is_superadmin = True
user.save(using=self._db)
return user

class Account(AbstractBaseUser):
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
username = models.CharField(max_length=50, unique=True)
email = models.EmailField(max_length=100, unique=True)
phone_number = models.CharField(max_length=50)

# required
date_joined = models.DateTimeField(auto_now_add=True)
last_login = models.DateTimeField(auto_now_add=True)
is_admin = models.BooleanField(default=False)
is_staff = models.BooleanField(default=False)
is_active = models.BooleanField(default=False)
is_superadmin = models.BooleanField(default=False)

USERNAME_FIELD = 'email'
REQUIRED_FIELDS = ['username', 'first_name', 'last_name']

objects = MyAccountManager()

def full_name(self):
return f'{self.first_name} {self.last_name}'

def __str__(self):
return self.email

def has_perm(self, perm, obj=None):


return self.is_admin

def has_module_perms(self, add_label):


return True

class UserProfile(models.Model):
user = models.OneToOneField(Account, on_delete=models.CASCADE)
address_line_1 = models.CharField(blank=True, max_length=100)
address_line_2 = models.CharField(blank=True, max_length=100)
profile_picture = models.ImageField(blank=True, upload_to='userprofile')
city = models.CharField(blank=True, max_length=20)
state = models.CharField(blank=True, max_length=20)
country = models.CharField(blank=True, max_length=20)

def __str__(self):
return self.user.first_name

def full_address(self):
return f'{self.address_line_1} {self.address_line_2}'
from django.test import TestCase

# Create your tests here.

from django.urls import path


from . import views

urlpatterns = [

E-Commerce Website 32
SEA College Of Science, Commerce and Art’s

path('register/', views.register, name='register'),


path('login/', views.login, name='login'),
path('logout/', views.logout, name='logout'),
path('dashboard/', views.dashboard, name='dashboard'),
path('', views.dashboard, name='dashboard'),

path('activate/<uidb64>/<token>/', views.activate, name='activate'),


path('forgotPassword/', views.forgotPassword, name='forgotPassword'),
path('resetpassword_validate/<uidb64>/<token>/', views.resetpassword_validate,
name='resetpassword_validate'),
path('resetPassword/', views.resetPassword, name='resetPassword'),

path('my_orders/', views.my_orders, name='my_orders'),


path('edit_profile/', views.edit_profile, name='edit_profile'),
path('change_password/', views.change_password, name='change_password'),
path('order_detail/<int:order_id>/', views.order_detail, name='order_detail'),

from django.shortcuts import render, redirect, get_object_or_404


from .forms import RegistrationForm, UserForm, UserProfileForm
from .models import Account, UserProfile
from orders.models import Order, OrderProduct
from django.contrib import messages, auth
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse

# Verification email
from django.contrib.sites.shortcuts import get_current_site
from django.template.loader import render_to_string
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
from django.utils.encoding import force_bytes
from django.contrib.auth.tokens import default_token_generator
from django.core.mail import EmailMessage

from cart.views import _cart_id


from cart.models import Cart, CartItem
import requests

def register(request):
if request.method == 'POST':
form = RegistrationForm(request.POST)
if form.is_valid():
first_name = form.cleaned_data['first_name']
last_name = form.cleaned_data['last_name']
phone_number = form.cleaned_data['phone_number']
email = form.cleaned_data['email']
password = form.cleaned_data['password']
username = email.split("@")[0]
user = Account.objects.create_user(first_name=first_name, last_name=last_name,
email=email, username=username, password=password)
user.phone_number = phone_number
user.save()

# Create a user profile


profile = UserProfile()
profile.user_id = user.id
profile.profile_picture = 'default/default-user.png'
profile.save()

# USER ACTIVATION
current_site = get_current_site(request)
mail_subject = 'Please activate your account'
message = render_to_string('accounts/account_verification_email.html', {
'user': user,
'domain': current_site,
'uid': urlsafe_base64_encode(force_bytes(user.pk)),
'token': default_token_generator.make_token(user),
})
to_email = email
send_email = EmailMessage(mail_subject, message, to=[to_email])
send_email.send()
# messages.success(request, 'Thank you for registering with us. We have sent you a
verification email to your email address [[email protected]]. Please verify it.')

E-Commerce Website 33
SEA College Of Science, Commerce and Art’s

return redirect('/accounts/login/?command=verification&email='+email)
else:
form = RegistrationForm()
context = {
'form': form,
}
return render(request, 'accounts/register.html', context)

def login(request):
if request.method == 'POST':
email = request.POST['email']
password = request.POST['password']

user = auth.authenticate(email=email, password=password)

if user is not None:


try:
cart = Cart.objects.get(cart_id=_cart_id(request))
is_cart_item_exists = CartItem.objects.filter(cart=cart).exists()
if is_cart_item_exists:
cart_item = CartItem.objects.filter(cart=cart)

# Getting the product variations by cart id


product_variation = []
for item in cart_item:
variation = item.variations.all()
product_variation.append(list(variation))

# Get the cart items from the user to access his product variations
cart_item = CartItem.objects.filter(user=user)
ex_var_list = []
id = []
for item in cart_item:
existing_variation = item.variations.all()
ex_var_list.append(list(existing_variation))
id.append(item.id)

# product_variation = [1, 2, 3, 4, 6]
# ex_var_list = [4, 6, 3, 5]

for pr in product_variation:
if pr in ex_var_list:
index = ex_var_list.index(pr)
item_id = id[index]
item = CartItem.objects.get(id=item_id)
item.quantity += 1
item.user = user
item.save()
else:
cart_item = CartItem.objects.filter(cart=cart)
for item in cart_item:
item.user = user
item.save()
except:
pass
auth.login(request, user)
messages.success(request, 'You are now logged in.')
url = request.META.get('HTTP_REFERER')
try:
query = requests.utils.urlparse(url).query
# next=/cart/checkout/
params = dict(x.split('=') for x in query.split('&'))
if 'next' in params:
nextPage = params['next']
return redirect(nextPage)
except:
return redirect('dashboard')
else:
messages.error(request, 'Invalid login credentials')
return redirect('login')
return render(request, 'accounts/login.html')

@login_required(login_url = 'login')
def logout(request):

E-Commerce Website 34
SEA College Of Science, Commerce and Art’s

auth.logout(request)
messages.success(request, 'You are logged out.')
return redirect('login')

def activate(request, uidb64, token):


try:
uid = urlsafe_base64_decode(uidb64).decode()
user = Account._default_manager.get(pk=uid)
except(TypeError, ValueError, OverflowError, Account.DoesNotExist):
user = None

if user is not None and default_token_generator.check_token(user, token):


user.is_active = True
user.save()
messages.success(request, 'Congratulations! Your account is activated.')
return redirect('login')
else:
messages.error(request, 'Invalid activation link')
return redirect('register')

@login_required(login_url = 'login')
def dashboard(request):
orders = Order.objects.order_by('-created_at').filter(user_id=request.user.id,
is_ordered=True)
orders_count = orders.count()

userprofile = UserProfile.objects.get(user_id=request.user.id)
context = {
'orders_count': orders_count,
'userprofile': userprofile,
}
return render(request, 'accounts/dashboard.html', context)

def forgotPassword(request):
if request.method == 'POST':
email = request.POST['email']
if Account.objects.filter(email=email).exists():
user = Account.objects.get(email__exact=email)

# Reset password email


current_site = get_current_site(request)
mail_subject = 'Reset Your Password'
message = render_to_string('accounts/reset_password_email.html', {
'user': user,
'domain': current_site,
'uid': urlsafe_base64_encode(force_bytes(user.pk)),
'token': default_token_generator.make_token(user),
})
to_email = email
send_email = EmailMessage(mail_subject, message, to=[to_email])
send_email.send()

messages.success(request, 'Password reset email has been sent to your email


address.')
return redirect('login')
else:
messages.error(request, 'Account does not exist!')
return redirect('forgotPassword')
return render(request, 'accounts/forgotPassword.html')

def resetpassword_validate(request, uidb64, token):


try:
uid = urlsafe_base64_decode(uidb64).decode()
user = Account._default_manager.get(pk=uid)
except(TypeError, ValueError, OverflowError, Account.DoesNotExist):
user = None

if user is not None and default_token_generator.check_token(user, token):


request.session['uid'] = uid
messages.success(request, 'Please reset your password')
return redirect('resetPassword')
else:
messages.error(request, 'This link has been expired!')
return redirect('login')

E-Commerce Website 35
SEA College Of Science, Commerce and Art’s

def resetPassword(request):
if request.method == 'POST':
password = request.POST['password']
confirm_password = request.POST['confirm_password']

if password == confirm_password:
uid = request.session.get('uid')
user = Account.objects.get(pk=uid)
user.set_password(password)
user.save()
messages.success(request, 'Password reset successful')
return redirect('login')
else:
messages.error(request, 'Password do not match!')
return redirect('resetPassword')
else:
return render(request, 'accounts/resetPassword.html')

@login_required(login_url='login')
def my_orders(request):
orders = Order.objects.filter(user=request.user, is_ordered=True).order_by('-created_at')
context = {
'orders': orders,
}
return render(request, 'accounts/my_orders.html', context)

@login_required(login_url='login')
def edit_profile(request):
userprofile = get_object_or_404(UserProfile, user=request.user)
if request.method == 'POST':
user_form = UserForm(request.POST, instance=request.user)
profile_form = UserProfileForm(request.POST, request.FILES, instance=userprofile)
if user_form.is_valid() and profile_form.is_valid():
user_form.save()
profile_form.save()
messages.success(request, 'Your profile has been updated.')
return redirect('edit_profile')
else:
user_form = UserForm(instance=request.user)
profile_form = UserProfileForm(instance=userprofile)
context = {
'user_form': user_form,
'profile_form': profile_form,
'userprofile': userprofile,
}
return render(request, 'accounts/edit_profile.html', context)

@login_required(login_url='login')
def change_password(request):
if request.method == 'POST':
current_password = request.POST['current_password']
new_password = request.POST['new_password']
confirm_password = request.POST['confirm_password']

user = Account.objects.get(username__exact=request.user.username)

if new_password == confirm_password:
success = user.check_password(current_password)
if success:
user.set_password(new_password)
user.save()
# auth.logout(request)
messages.success(request, 'Password updated successfully.')
return redirect('change_password')
else:
messages.error(request, 'Please enter valid current password')
return redirect('change_password')
else:
messages.error(request, 'Password does not match!')
return redirect('change_password')
return render(request, 'accounts/change_password.html')

@login_required(login_url='login')
def order_detail(request, order_id):

E-Commerce Website 36
SEA College Of Science, Commerce and Art’s

order_detail = OrderProduct.objects.filter(order__order_number=order_id)
order = Order.objects.get(order_number=order_id)
subtotal = 0
for i in order_detail:
subtotal += i.product_price * i.quantity

context = {
'order_detail': order_detail,
'order': order,
'subtotal': subtotal,
}
return render(request, 'accounts/order_detail.html', context)
ArtiZan

"""
ASGI config for ArtiZan project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see


https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ArtiZan.settings')

application = get_asgi_application()

"""
Django settings for ArtiZan project.

Generated by 'django-admin startproject' using Django 4.1.7.

For more information on this file, see


https://docs.djangoproject.com/en/4.1/topics/settings/

For the full list of settings and their values, see


https://docs.djangoproject.com/en/4.1/ref/settings/
"""

import os
from pathlib import Path
from decouple import config

# Build paths inside the project like this: BASE_DIR / 'subdir'.


BASE_DIR = Path(__file__).resolve().parent.parent

# Quick-start development settings - unsuitable for production


# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!


SECRET_KEY = config('SECRET_KEY')

# SECURITY WARNING: don't run with debug turned on in production!


DEBUG = config('DEBUG' ,default=True,cast=bool)

ALLOWED_HOSTS = []

# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'shop',
'category',
'accounts',
'cart',

E-Commerce Website 37
SEA College Of Science, Commerce and Art’s

'orders',
'admin_honeypot',

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',
'django_session_timeout.middleware.SessionTimeoutMiddleware',
]

SESSION_EXPIRE_SECONDS = 3600 # 10 days //3600 # 1 hour


SESSION_EXPIRE_AFTER_LAST_ACTIVITY = True
SESSION_TIMEOUT_REDIRECT = 'accounts/login'

ROOT_URLCONF = 'ArtiZan.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',
'category.context_processors.menu_links',
'cart.context_processors.counter',
],
},
},
]

WSGI_APPLICATION = 'ArtiZan.wsgi.application'
AUTH_USER_MODEL = 'accounts.Account' # admin path set up

# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}

# Password validation
# https://docs.djangoproject.com/en/4.1/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/4.1/topics/i18n/

E-Commerce Website 38
SEA College Of Science, Commerce and Art’s

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_TZ = True

# Static files (CSS, JavaScript, Images)


# https://docs.djangoproject.com/en/4.1/howto/static-files/

# STATIC_URL = '/static/'
# STATIC_ROOT = BASE_DIR /'static'
# STATICFILES_DIRS = [
# '/static',
# ]

# # media files configuration


# MEDIA_URL = '/media/'
# MEDIA_ROOT = BASE_DIR /'media'

STATIC_URL = '/static/'
STATICFILES_DIRS=[os.path.join(BASE_DIR,'static')]
STATIC_ROOT=os.path.join(BASE_DIR,'assets')
MEDIA_URL='/media/'
MEDIA_ROOT=os.path.join(BASE_DIR,'media')

# alert messages
from django.contrib.messages import constants as messages
MESSAGE_TAGS = {
messages.ERROR: 'danger',
}

# SMTP CONFIGURATION

EMAIL_BACKEND = config('EMAIL_BACKEND')
EMAIL_HOST = config('EMAIL_HOST',default='localhost')
EMAIL_PORT = config('EMAIL_PORT',cast=int)
EMAIL_USE_TLS = config('EMAIL_USE_TLS', cast=bool)
EMAIL_HOST_USER = config('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD')
# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

"""ArtiZan URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from . import views
from django.conf.urls.static import static
from django.conf import settings

urlpatterns = [
path('admin/', include('admin_honeypot.urls', namespace='admin_honeypot')),# fake admin
path('zan123/', admin.site.urls),#admin urls you can change anytime
path('', views.home, name='home'),
path('shop/', include('shop.urls')),
path('cart/', include('cart.urls')),
path('accounts/', include('accounts.urls')),

E-Commerce Website 39
SEA College Of Science, Commerce and Art’s

# ORDERS
path('orders/', include('orders.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

from django.shortcuts import render


from shop.models import Product, ReviewRating

def home(request):
products = Product.objects.all().filter(is_available=True).order_by('created_date')

# Get the reviews


reviews = None
for product in products:
reviews = ReviewRating.objects.filter(product_id=product.id, status=True)

context = {
'products': products,
'reviews': reviews,
}
return render(request, 'home.html', context)
"""
WSGI config for ArtiZan project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see


https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ArtiZan.settings')

application = get_wsgi_application()

Cart

# Generated by Django 3.1 on 2023-08-24 02:25

from django.conf import settings


from django.db import migrations, models
import django.db.models.deletion

class Migration(migrations.Migration):

initial = True

dependencies = [
('shop', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='Cart',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False,
verbose_name='ID')),
('cart_id', models.CharField(blank=True, max_length=250)),
('date_added', models.DateField(auto_now_add=True)),
],
),
migrations.CreateModel(
name='CartItem',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False,
verbose_name='ID')),
('quantity', models.IntegerField()),

E-Commerce Website 40
SEA College Of Science, Commerce and Art’s

('is_active', models.BooleanField(default=True)),
('cart', models.ForeignKey(null=True,
on_delete=django.db.models.deletion.CASCADE, to='cart.cart')),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
to='shop.product')),
('user', models.ForeignKey(null=True,
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
('variations', models.ManyToManyField(blank=True, to='shop.Variation')),
],
),
]

from django.contrib import admin


from .models import Cart, CartItem
# Register your models here.

class CartAdmin(admin.ModelAdmin):
list_display = ('cart_id', 'date_added')

class CartItemAdmin(admin.ModelAdmin):
list_display = ('product', 'cart', 'quantity', 'is_active')

admin.site.register(Cart, CartAdmin)
admin.site.register(CartItem, CartItemAdmin)

from django.apps import AppConfig

class CartConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'cart'

from .models import Cart, CartItem


from .views import _cart_id

def counter(request):
cart_count = 0
if 'admin' in request.path:
return {}
else:
try:
cart = Cart.objects.filter(cart_id=_cart_id(request))
if request.user.is_authenticated:
cart_items = CartItem.objects.all().filter(user=request.user)
else:
cart_items = CartItem.objects.all().filter(cart=cart[:1])
for cart_item in cart_items:
cart_count += cart_item.quantity
except Cart.DoesNotExist:
cart_count = 0
return dict(cart_count=cart_count)
from django.db import models
from shop.models import Product, Variation
from accounts.models import Account

# Create your models here.

class Cart(models.Model):
cart_id = models.CharField(max_length=250, blank=True)
date_added = models.DateField(auto_now_add=True)

def __str__(self):
return self.cart_id

class CartItem(models.Model):
user = models.ForeignKey(Account, on_delete=models.CASCADE, null=True)
product = models.ForeignKey(Product, on_delete=models.CASCADE)
variations = models.ManyToManyField(Variation, blank=True)
cart = models.ForeignKey(Cart, on_delete=models.CASCADE, null=True)
quantity = models.IntegerField()
is_active = models.BooleanField(default=True)

def sub_total(self):
return self.product.price * self.quantity

E-Commerce Website 41
SEA College Of Science, Commerce and Art’s

def __unicode__(self):
return self.product
from django.test import TestCase

# Create your tests here.

from django.urls import path


from . import views

urlpatterns = [
path('', views.cart, name='cart'),
path('add_cart/<int:product_id>/', views.add_cart, name='add_cart'),
path('remove_cart/<int:product_id>/<int:cart_item_id>/', views.remove_cart,
name='remove_cart'),
path('remove_cart_item/<int:product_id>/<int:cart_item_id>/', views.remove_cart_item,
name='remove_cart_item'),

path('checkout/', views.checkout, name='checkout'),


]

from django.shortcuts import render, redirect, get_object_or_404


from shop.models import Product, Variation
from .models import Cart, CartItem
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.decorators import login_required

# Create your views here.


from django.http import HttpResponse

def _cart_id(request):
cart = request.session.session_key
if not cart:
cart = request.session.create()
return cart

def add_cart(request, product_id):


current_user = request.user
product = Product.objects.get(id=product_id) #get the product
# If the user is authenticated
if current_user.is_authenticated:
product_variation = []
if request.method == 'POST':
for item in request.POST:
key = item
value = request.POST[key]

try:
variation = Variation.objects.get(product=product,
variation_category__iexact=key, variation_value__iexact=value)
product_variation.append(variation)
except:
pass

is_cart_item_exists = CartItem.objects.filter(product=product,
user=current_user).exists()
if is_cart_item_exists:
cart_item = CartItem.objects.filter(product=product, user=current_user)
ex_var_list = []
id = []
for item in cart_item:
existing_variation = item.variations.all()
ex_var_list.append(list(existing_variation))
id.append(item.id)

if product_variation in ex_var_list:
# increase the cart item quantity
index = ex_var_list.index(product_variation)
item_id = id[index]
item = CartItem.objects.get(product=product, id=item_id)
item.quantity += 1
item.save()

else:
item = CartItem.objects.create(product=product, quantity=1, user=current_user)

E-Commerce Website 42
SEA College Of Science, Commerce and Art’s

if len(product_variation) > 0:
item.variations.clear()
item.variations.add(*product_variation)
item.save()
else:
cart_item = CartItem.objects.create(
product = product,
quantity = 1,
user = current_user,
)
if len(product_variation) > 0:
cart_item.variations.clear()
cart_item.variations.add(*product_variation)
cart_item.save()
return redirect('cart')
# If the user is not authenticated
else:
product_variation = []
if request.method == 'POST':
for item in request.POST:
key = item
value = request.POST[key]

try:
variation = Variation.objects.get(product=product,
variation_category__iexact=key, variation_value__iexact=value)
product_variation.append(variation)
except:
pass

try:
cart = Cart.objects.get(cart_id=_cart_id(request)) # get the cart using the cart_id
present in the session
except Cart.DoesNotExist:
cart = Cart.objects.create(
cart_id = _cart_id(request)
)
cart.save()

is_cart_item_exists = CartItem.objects.filter(product=product, cart=cart).exists()


if is_cart_item_exists:
cart_item = CartItem.objects.filter(product=product, cart=cart)
# existing_variations -> database
# current variation -> product_variation
# item_id -> database
ex_var_list = []
id = []
for item in cart_item:
existing_variation = item.variations.all()
ex_var_list.append(list(existing_variation))
id.append(item.id)

print(ex_var_list)

if product_variation in ex_var_list:
# increase the cart item quantity
index = ex_var_list.index(product_variation)
item_id = id[index]
item = CartItem.objects.get(product=product, id=item_id)
item.quantity += 1
item.save()

else:
item = CartItem.objects.create(product=product, quantity=1, cart=cart)
if len(product_variation) > 0:
item.variations.clear()
item.variations.add(*product_variation)
item.save()
else:
cart_item = CartItem.objects.create(
product = product,
quantity = 1,
cart = cart,
)

E-Commerce Website 43
SEA College Of Science, Commerce and Art’s

if len(product_variation) > 0:
cart_item.variations.clear()
cart_item.variations.add(*product_variation)
cart_item.save()
return redirect('cart')

def remove_cart(request, product_id, cart_item_id):

product = get_object_or_404(Product, id=product_id)


try:
if request.user.is_authenticated:
cart_item = CartItem.objects.get(product=product, user=request.user,
id=cart_item_id)
else:
cart = Cart.objects.get(cart_id=_cart_id(request))
cart_item = CartItem.objects.get(product=product, cart=cart, id=cart_item_id)
if cart_item.quantity > 1:
cart_item.quantity -= 1
cart_item.save()
else:
cart_item.delete()
except:
pass
return redirect('cart')

def remove_cart_item(request, product_id, cart_item_id):


product = get_object_or_404(Product, id=product_id)
if request.user.is_authenticated:
cart_item = CartItem.objects.get(product=product, user=request.user, id=cart_item_id)
else:
cart = Cart.objects.get(cart_id=_cart_id(request))
cart_item = CartItem.objects.get(product=product, cart=cart, id=cart_item_id)
cart_item.delete()
return redirect('cart')

def cart(request, total=0, quantity=0, cart_items=None):


try:
tax = 0
grand_total = 0
if request.user.is_authenticated:
cart_items = CartItem.objects.filter(user=request.user, is_active=True)
else:
cart = Cart.objects.get(cart_id=_cart_id(request))
cart_items = CartItem.objects.filter(cart=cart, is_active=True)
for cart_item in cart_items:
total += (cart_item.product.price * cart_item.quantity)
quantity += cart_item.quantity
tax = (2 * total)/100
grand_total = total + tax
except ObjectDoesNotExist:
pass #just ignore

context = {
'total': total,
'quantity': quantity,
'cart_items': cart_items,
'tax' : tax,
'grand_total': grand_total,
}
return render(request, 'store/cart.html', context)

@login_required(login_url='login')
def checkout(request, total=0, quantity=0, cart_items=None):
try:
tax = 0
grand_total = 0
if request.user.is_authenticated:
cart_items = CartItem.objects.filter(user=request.user, is_active=True)
else:
cart = Cart.objects.get(cart_id=_cart_id(request))
cart_items = CartItem.objects.filter(cart=cart, is_active=True)
for cart_item in cart_items:
total += (cart_item.product.price * cart_item.quantity)
quantity += cart_item.quantity

E-Commerce Website 44
SEA College Of Science, Commerce and Art’s

tax = (2 * total)/100
grand_total = total + tax
except ObjectDoesNotExist:
pass #just ignore

context = {
'total': total,
'quantity': quantity,
'cart_items': cart_items,
'tax' : tax,
'grand_total': grand_total,
}
return render(request, 'store/checkout.html', context)

Category

# Generated by Django 3.1 on 2023-08-24 02:25

from django.db import migrations, models

class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False,
verbose_name='ID')),
('category_name', models.CharField(max_length=50, unique=True)),
('slug', models.SlugField(max_length=100, unique=True)),
('description', models.TextField(blank=True, max_length=255)),
('cat_image', models.ImageField(blank=True, upload_to='photos/categories')),
],
options={
'verbose_name': 'category',
'verbose_name_plural': 'categories',
},
),
]

from django.contrib import admin


from .models import Category

# Register your models here.

class CategoryAdmin(admin.ModelAdmin):
prepopulated_fields = {'slug': ('category_name',)}
list_display = ('category_name', 'slug')

admin.site.register(Category, CategoryAdmin)

from django.apps import AppConfig

class CategoryConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'category'

from .models import Category

def menu_links(request):
links = Category.objects.all()
return dict(links=links)
from django.db import models
from django.urls import reverse

# Create your models here.

class Category(models.Model):
category_name = models.CharField(max_length=50, unique=True)

E-Commerce Website 45
SEA College Of Science, Commerce and Art’s

slug = models.SlugField(max_length=100, unique=True)


description = models.TextField(max_length=255, blank=True)
cat_image = models.ImageField(upload_to='photos/categories', blank=True)

class Meta:
verbose_name = 'category'
verbose_name_plural = 'categories'

def get_url(self):
return reverse('products_by_category', args=[self.slug])

def __str__(self):
return self.category_name
from django.test import TestCase

# Create your tests here.

from django.shortcuts import render

# Create your views here.

Env

"""Patches that are applied at runtime to the virtual environment."""

from __future__ import annotations

import os
import sys
from contextlib import suppress

VIRTUALENV_PATCH_FILE = os.path.join(__file__)

def patch_dist(dist):
"""
Distutils allows user to configure some arguments via a configuration file:
https://docs.python.org/3/install/index.html#distutils-configuration-files.

Some of this arguments though don't make sense in context of the virtual environment files,
let's fix them up.
""" # noqa: D205
# we cannot allow some install config as that would get packages installed outside of the
virtual environment
old_parse_config_files = dist.Distribution.parse_config_files

def parse_config_files(self, *args, **kwargs):


result = old_parse_config_files(self, *args, **kwargs)
install = self.get_option_dict("install")

if "prefix" in install: # the prefix governs where to install the libraries


install["prefix"] = VIRTUALENV_PATCH_FILE, os.path.abspath(sys.prefix)
for base in ("purelib", "platlib", "headers", "scripts", "data"):
key = f"install_{base}"
if key in install: # do not allow global configs to hijack venv paths
install.pop(key, None)
return result

dist.Distribution.parse_config_files = parse_config_files

# Import hook that patches some modules to ignore configuration values that break package
installation in case
# of virtual environments.
_DISTUTILS_PATCH = "distutils.dist", "setuptools.dist"
# https://docs.python.org/3/library/importlib.html#setting-up-an-importer

class _Finder:
"""A meta path finder that allows patching the imported distutils modules."""

fullname = None

# lock[0] is threading.Lock(), but initialized lazily to avoid importing threading very


early at startup,
# because there are gevent-based applications that need to be first to import threading by
themselves.

E-Commerce Website 46
SEA College Of Science, Commerce and Art’s

# See https://github.com/pypa/virtualenv/issues/1895 for details.


lock = [] # noqa: RUF012

def find_spec(self, fullname, path, target=None): # noqa: ARG002


if fullname in _DISTUTILS_PATCH and self.fullname is None:
# initialize lock[0] lazily
if len(self.lock) == 0:
import threading

lock = threading.Lock()
# there is possibility that two threads T1 and T2 are simultaneously running
into find_spec,
# observing .lock as empty, and further going into hereby initialization.
However due to the GIL,
# list.append() operation is atomic and this way only one of the threads will
"win" to put the lock
# - that every thread will use - into .lock[0].
# https://docs.python.org/3/faq/library.html#what-kinds-of-global-value-
mutation-are-thread-safe
self.lock.append(lock)

from functools import partial


from importlib.util import find_spec

with self.lock[0]:
self.fullname = fullname
try:
spec = find_spec(fullname, path)
if spec is not None:
# https://www.python.org/dev/peps/pep-0451/#how-loading-will-work
is_new_api = hasattr(spec.loader, "exec_module")
func_name = "exec_module" if is_new_api else "load_module"
old = getattr(spec.loader, func_name)
func = self.exec_module if is_new_api else self.load_module
if old is not func:
with suppress(AttributeError): # C-Extension loaders are r/o such
as zipimporter with <3.7
setattr(spec.loader, func_name, partial(func, old))
return spec
finally:
self.fullname = None
return None

@staticmethod
def exec_module(old, module):
old(module)
if module.__name__ in _DISTUTILS_PATCH:
patch_dist(module)

@staticmethod
def load_module(old, name):
module = old(name)
if module.__name__ in _DISTUTILS_PATCH:
patch_dist(module)
return module

sys.meta_path.insert(0, _Finder())

# coding: utf-8
import os
import sys
import string
from shlex import shlex
from io import open
from collections import OrderedDict
from distutils.util import strtobool

# Useful for very coarse version differentiation.


PY3 = sys.version_info[0] == 3

if PY3:
from configparser import ConfigParser
text_type = str
else:

E-Commerce Website 47
SEA College Of Science, Commerce and Art’s

from ConfigParser import SafeConfigParser as ConfigParser


text_type = unicode

DEFAULT_ENCODING = 'UTF-8'

class UndefinedValueError(Exception):
pass

class Undefined(object):
"""
Class to represent undefined type.
"""
pass

# Reference instance to represent undefined values


undefined = Undefined()

class Config(object):
"""
Handle .env file format used by Foreman.
"""

def __init__(self, repository):


self.repository = repository

def _cast_boolean(self, value):


"""
Helper to convert config values to boolean as ConfigParser do.
"""
value = str(value)
return bool(value) if value == '' else bool(strtobool(value))

@staticmethod
def _cast_do_nothing(value):
return value

def get(self, option, default=undefined, cast=undefined):


"""
Return the value for option or default if defined.
"""

# We can't avoid __contains__ because value may be empty.


if option in os.environ:
value = os.environ[option]
elif option in self.repository:
value = self.repository[option]
else:
if isinstance(default, Undefined):
raise UndefinedValueError('{} not found. Declare it as envvar or define a
default value.'.format(option))

value = default

if isinstance(cast, Undefined):
cast = self._cast_do_nothing
elif cast is bool:
cast = self._cast_boolean

return cast(value)

def __call__(self, *args, **kwargs):


"""
Convenient shortcut to get.
"""
return self.get(*args, **kwargs)

class RepositoryEmpty(object):
def __init__(self, source='', encoding=DEFAULT_ENCODING):
pass

def __contains__(self, key):


return False

def __getitem__(self, key):

E-Commerce Website 48
SEA College Of Science, Commerce and Art’s

return None

class RepositoryIni(RepositoryEmpty):
"""
Retrieves option keys from .ini files.
"""
SECTION = 'settings'

def __init__(self, source, encoding=DEFAULT_ENCODING):


self.parser = ConfigParser()
with open(source, encoding=encoding) as file_:
self.parser.readfp(file_)

def __contains__(self, key):


return (key in os.environ or
self.parser.has_option(self.SECTION, key))

def __getitem__(self, key):


return self.parser.get(self.SECTION, key)

class RepositoryEnv(RepositoryEmpty):
"""
Retrieves option keys from .env files with fall back to os.environ.
"""
def __init__(self, source, encoding=DEFAULT_ENCODING):
self.data = {}

with open(source, encoding=encoding) as file_:


for line in file_:
line = line.strip()
if not line or line.startswith('#') or '=' not in line:
continue
k, v = line.split('=', 1)
k = k.strip()
v = v.strip()
if len(v) >= 2 and ((v[0] == "'" and v[-1] == "'") or (v[0] == '"' and v[-1] ==
'"')):
v = v.strip('\'"')
self.data[k] = v

def __contains__(self, key):


return key in os.environ or key in self.data

def __getitem__(self, key):


return self.data[key]

class AutoConfig(object):
"""
Autodetects the config file and type.

Parameters
----------
search_path : str, optional
Initial search path. If empty, the default search path is the
caller's path.

"""
SUPPORTED = OrderedDict([
('settings.ini', RepositoryIni),
('.env', RepositoryEnv),
])

encoding = DEFAULT_ENCODING

def __init__(self, search_path=None):


self.search_path = search_path
self.config = None

def _find_file(self, path):


# look for all files in the current path
for configfile in self.SUPPORTED:
filename = os.path.join(path, configfile)
if os.path.isfile(filename):
return filename

E-Commerce Website 49
SEA College Of Science, Commerce and Art’s

# search the parent


parent = os.path.dirname(path)
if parent and parent != os.path.abspath(os.sep):
return self._find_file(parent)

# reached root without finding any files.


return ''

def _load(self, path):


# Avoid unintended permission errors
try:
filename = self._find_file(os.path.abspath(path))
except Exception:
filename = ''
Repository = self.SUPPORTED.get(os.path.basename(filename), RepositoryEmpty)

self.config = Config(Repository(filename, encoding=self.encoding))

def _caller_path(self):
# MAGIC! Get the caller's module path.
frame = sys._getframe()
path = os.path.dirname(frame.f_back.f_back.f_code.co_filename)
return path

def __call__(self, *args, **kwargs):


if not self.config:
self._load(self.search_path or self._caller_path())

return self.config(*args, **kwargs)

# A pré-instantiated AutoConfig to improve decouple's usability


# now just import config and start using with no configuration.
config = AutoConfig()

# Helpers

class Csv(object):
"""
Produces a csv parser that return a list of transformed elements.
"""

def __init__(self, cast=text_type, delimiter=',', strip=string.whitespace,


post_process=list):
"""
Parameters:
cast -- callable that transforms the item just before it's added to the list.
delimiter -- string of delimiters chars passed to shlex.
strip -- string of non-relevant characters to be passed to str.strip after the split.
post_process -- callable to post process all casted values. Default is `list`.
"""
self.cast = cast
self.delimiter = delimiter
self.strip = strip
self.post_process = post_process

def __call__(self, value):


"""The actual transformation"""
transform = lambda s: self.cast(s.strip(self.strip))

splitter = shlex(value, posix=True)


splitter.whitespace = self.delimiter
splitter.whitespace_split = True

return self.post_process(transform(s) for s in splitter)

class Choices(object):
"""
Allows for cast and validation based on a list of choices.
"""

def __init__(self, flat=None, cast=text_type, choices=None):


"""
Parameters:
flat -- a flat list of valid choices.

E-Commerce Website 50
SEA College Of Science, Commerce and Art’s

cast -- callable that transforms value before validation.


choices -- tuple of Django-like choices.
"""
self.flat = flat or []
self.cast = cast
self.choices = choices or []

self._valid_values = []
self._valid_values.extend(self.flat)
self._valid_values.extend([value for value, _ in self.choices])

def __call__(self, value):


transform = self.cast(value)
if transform not in self._valid_values:
raise ValueError((
'Value not in list: {!r}; valid values are {!r}'
).format(value, self._valid_values))
else:
return transform

import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get(var, 'local') == 'local';


enabled and __import__('_distutils_hack').add_shim();
# SOFTWARE.

"""Utilities for writing code that runs on Python 2 and 3"""

from __future__ import absolute_import

import functools
import itertools
import operator
import sys
import types

__author__ = "Benjamin Peterson <[email protected]>"


__version__ = "1.15.0"

# Useful for very coarse version differentiation.


PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
PY34 = sys.version_info[0:2] >= (3, 4)

if PY3:
string_types = str,
integer_types = int,
class_types = type,
text_type = str
binary_type = bytes

MAXSIZE = sys.maxsize
else:
string_types = basestring,
integer_types = (int, long)
class_types = (type, types.ClassType)
text_type = unicode
binary_type = str

if sys.platform.startswith("java"):
# Jython always uses 32 bits.
MAXSIZE = int((1 << 31) - 1)
else:
# It's possible to have sizeof(long) != sizeof(Py_ssize_t).
class X(object):

def __len__(self):
return 1 << 31
try:
len(X())
except OverflowError:
# 32-bit
MAXSIZE = int((1 << 31) - 1)
else:
# 64-bit
MAXSIZE = int((1 << 63) - 1)

E-Commerce Website 51
SEA College Of Science, Commerce and Art’s

del X

def _add_doc(func, doc):


"""Add documentation to a function."""
func.__doc__ = doc

def _import_module(name):
"""Import module, returning the module after the last dot."""
__import__(name)
return sys.modules[name]

class _LazyDescr(object):

def __init__(self, name):


self.name = name

def __get__(self, obj, tp):


result = self._resolve()
setattr(obj, self.name, result) # Invokes __set__.
try:
# This is a bit ugly, but it avoids running this again by
# removing this descriptor.
delattr(obj.__class__, self.name)
except AttributeError:
pass
return result

class MovedModule(_LazyDescr):

def __init__(self, name, old, new=None):


super(MovedModule, self).__init__(name)
if PY3:
if new is None:
new = name
self.mod = new
else:
self.mod = old

def _resolve(self):
return _import_module(self.mod)

def __getattr__(self, attr):


_module = self._resolve()
value = getattr(_module, attr)
setattr(self, attr, value)
return value

class _LazyModule(types.ModuleType):

def __init__(self, name):


super(_LazyModule, self).__init__(name)
self.__doc__ = self.__class__.__doc__

def __dir__(self):
attrs = ["__doc__", "__name__"]
attrs += [attr.name for attr in self._moved_attributes]
return attrs

# Subclasses should override this


_moved_attributes = []

class MovedAttribute(_LazyDescr):

def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None):


super(MovedAttribute, self).__init__(name)
if PY3:
if new_mod is None:
new_mod = name
self.mod = new_mod
if new_attr is None:
if old_attr is None:
new_attr = name
else:
new_attr = old_attr

E-Commerce Website 52
SEA College Of Science, Commerce and Art’s

self.attr = new_attr
else:
self.mod = old_mod
if old_attr is None:
old_attr = name
self.attr = old_attr

def _resolve(self):
module = _import_module(self.mod)
return getattr(module, self.attr)

class _SixMetaPathImporter(object):

"""
A meta path importer to import six.moves and its submodules.

This class implements a PEP302 finder and loader. It should be compatible


with Python 2.5 and all existing versions of Python3
"""

def __init__(self, six_module_name):


self.name = six_module_name
self.known_modules = {}

def _add_module(self, mod, *fullnames):


for fullname in fullnames:
self.known_modules[self.name + "." + fullname] = mod

def _get_module(self, fullname):


return self.known_modules[self.name + "." + fullname]

def find_module(self, fullname, path=None):


if fullname in self.known_modules:
return self
return None

def __get_module(self, fullname):


try:
return self.known_modules[fullname]
except KeyError:
raise ImportError("This loader does not know module " + fullname)

def load_module(self, fullname):


try:
# in case of a reload
return sys.modules[fullname]
except KeyError:
pass
mod = self.__get_module(fullname)
if isinstance(mod, MovedModule):
mod = mod._resolve()
else:
mod.__loader__ = self
sys.modules[fullname] = mod
return mod

def is_package(self, fullname):


"""
Return true, if the named module is a package.

We need this method to get correct spec objects with


Python 3.4 (see PEP451)
"""
return hasattr(self.__get_module(fullname), "__path__")

def get_code(self, fullname):


"""Return None

Required, if is_package is implemented"""


self.__get_module(fullname) # eventually raises ImportError
return None
get_source = get_code # same as get_code

_importer = _SixMetaPathImporter(__name__)

E-Commerce Website 53
SEA College Of Science, Commerce and Art’s

class _MovedItems(_LazyModule):

"""Lazy loading of moved objects"""


__path__ = [] # mark as package

_moved_attributes = [
MovedAttribute("cStringIO", "cStringIO", "io", "StringIO"),
MovedAttribute("filter", "itertools", "builtins", "ifilter", "filter"),
MovedAttribute("filterfalse", "itertools", "itertools", "ifilterfalse", "filterfalse"),
MovedAttribute("input", "__builtin__", "builtins", "raw_input", "input"),
MovedAttribute("intern", "__builtin__", "sys"),
MovedAttribute("map", "itertools", "builtins", "imap", "map"),
MovedAttribute("getcwd", "os", "os", "getcwdu", "getcwd"),
MovedAttribute("getcwdb", "os", "os", "getcwd", "getcwdb"),
MovedAttribute("getoutput", "commands", "subprocess"),
MovedAttribute("range", "__builtin__", "builtins", "xrange", "range"),
MovedAttribute("reload_module", "__builtin__", "importlib" if PY34 else "imp", "reload"),
MovedAttribute("reduce", "__builtin__", "functools"),
MovedAttribute("shlex_quote", "pipes", "shlex", "quote"),
MovedAttribute("StringIO", "StringIO", "io"),
MovedAttribute("UserDict", "UserDict", "collections"),
MovedAttribute("UserList", "UserList", "collections"),
MovedAttribute("UserString", "UserString", "collections"),
MovedAttribute("xrange", "__builtin__", "builtins", "xrange", "range"),
MovedAttribute("zip", "itertools", "builtins", "izip", "zip"),
MovedAttribute("zip_longest", "itertools", "itertools", "izip_longest", "zip_longest"),
MovedModule("builtins", "__builtin__"),
MovedModule("configparser", "ConfigParser"),
MovedModule("collections_abc", "collections", "collections.abc" if sys.version_info >= (3,
3) else "collections"),
MovedModule("copyreg", "copy_reg"),
MovedModule("dbm_gnu", "gdbm", "dbm.gnu"),
MovedModule("dbm_ndbm", "dbm", "dbm.ndbm"),
MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread" if sys.version_info < (3, 9)
else "_thread"),
MovedModule("http_cookiejar", "cookielib", "http.cookiejar"),
MovedModule("http_cookies", "Cookie", "http.cookies"),
MovedModule("html_entities", "htmlentitydefs", "html.entities"),
MovedModule("html_parser", "HTMLParser", "html.parser"),
MovedModule("http_client", "httplib", "http.client"),
MovedModule("email_mime_base", "email.MIMEBase", "email.mime.base"),
MovedModule("email_mime_image", "email.MIMEImage", "email.mime.image"),
MovedModule("email_mime_multipart", "email.MIMEMultipart", "email.mime.multipart"),
MovedModule("email_mime_nonmultipart", "email.MIMENonMultipart", "email.mime.nonmultipart"),
MovedModule("email_mime_text", "email.MIMEText", "email.mime.text"),
MovedModule("BaseHTTPServer", "BaseHTTPServer", "http.server"),
MovedModule("CGIHTTPServer", "CGIHTTPServer", "http.server"),
MovedModule("SimpleHTTPServer", "SimpleHTTPServer", "http.server"),
MovedModule("cPickle", "cPickle", "pickle"),
MovedModule("queue", "Queue"),
MovedModule("reprlib", "repr"),
MovedModule("socketserver", "SocketServer"),
MovedModule("_thread", "thread", "_thread"),
MovedModule("tkinter", "Tkinter"),
MovedModule("tkinter_dialog", "Dialog", "tkinter.dialog"),
MovedModule("tkinter_filedialog", "FileDialog", "tkinter.filedialog"),
MovedModule("tkinter_scrolledtext", "ScrolledText", "tkinter.scrolledtext"),
MovedModule("tkinter_simpledialog", "SimpleDialog", "tkinter.simpledialog"),
MovedModule("tkinter_tix", "Tix", "tkinter.tix"),
MovedModule("tkinter_ttk", "ttk", "tkinter.ttk"),
MovedModule("tkinter_constants", "Tkconstants", "tkinter.constants"),
MovedModule("tkinter_dnd", "Tkdnd", "tkinter.dnd"),
MovedModule("tkinter_colorchooser", "tkColorChooser",
"tkinter.colorchooser"),
MovedModule("tkinter_commondialog", "tkCommonDialog",
"tkinter.commondialog"),
MovedModule("tkinter_tkfiledialog", "tkFileDialog", "tkinter.filedialog"),
MovedModule("tkinter_font", "tkFont", "tkinter.font"),
MovedModule("tkinter_messagebox", "tkMessageBox", "tkinter.messagebox"),
MovedModule("tkinter_tksimpledialog", "tkSimpleDialog",
"tkinter.simpledialog"),
MovedModule("urllib_parse", __name__ + ".moves.urllib_parse", "urllib.parse"),
MovedModule("urllib_error", __name__ + ".moves.urllib_error", "urllib.error"),
MovedModule("urllib", __name__ + ".moves.urllib", __name__ + ".moves.urllib"),

E-Commerce Website 54
SEA College Of Science, Commerce and Art’s

MovedModule("urllib_robotparser", "robotparser", "urllib.robotparser"),


MovedModule("xmlrpc_client", "xmlrpclib", "xmlrpc.client"),
MovedModule("xmlrpc_server", "SimpleXMLRPCServer", "xmlrpc.server"),
]
# Add windows specific modules.
if sys.platform == "win32":
_moved_attributes += [
MovedModule("winreg", "_winreg"),
]

for attr in _moved_attributes:


setattr(_MovedItems, attr.name, attr)
if isinstance(attr, MovedModule):
_importer._add_module(attr, "moves." + attr.name)
del attr

_MovedItems._moved_attributes = _moved_attributes

moves = _MovedItems(__name__ + ".moves")


_importer._add_module(moves, "moves")

class Module_six_moves_urllib_parse(_LazyModule):

"""Lazy loading of moved objects in six.moves.urllib_parse"""

_urllib_parse_moved_attributes = [
MovedAttribute("ParseResult", "urlparse", "urllib.parse"),
MovedAttribute("SplitResult", "urlparse", "urllib.parse"),
MovedAttribute("parse_qs", "urlparse", "urllib.parse"),
MovedAttribute("parse_qsl", "urlparse", "urllib.parse"),
MovedAttribute("urldefrag", "urlparse", "urllib.parse"),
MovedAttribute("urljoin", "urlparse", "urllib.parse"),
MovedAttribute("urlparse", "urlparse", "urllib.parse"),
MovedAttribute("urlsplit", "urlparse", "urllib.parse"),
MovedAttribute("urlunparse", "urlparse", "urllib.parse"),
MovedAttribute("urlunsplit", "urlparse", "urllib.parse"),
MovedAttribute("quote", "urllib", "urllib.parse"),
MovedAttribute("quote_plus", "urllib", "urllib.parse"),
MovedAttribute("unquote", "urllib", "urllib.parse"),
MovedAttribute("unquote_plus", "urllib", "urllib.parse"),
MovedAttribute("unquote_to_bytes", "urllib", "urllib.parse", "unquote", "unquote_to_bytes"),
MovedAttribute("urlencode", "urllib", "urllib.parse"),
MovedAttribute("splitquery", "urllib", "urllib.parse"),
MovedAttribute("splittag", "urllib", "urllib.parse"),
MovedAttribute("splituser", "urllib", "urllib.parse"),
MovedAttribute("splitvalue", "urllib", "urllib.parse"),
MovedAttribute("uses_fragment", "urlparse", "urllib.parse"),
MovedAttribute("uses_netloc", "urlparse", "urllib.parse"),
MovedAttribute("uses_params", "urlparse", "urllib.parse"),
MovedAttribute("uses_query", "urlparse", "urllib.parse"),
MovedAttribute("uses_relative", "urlparse", "urllib.parse"),
]
for attr in _urllib_parse_moved_attributes:
setattr(Module_six_moves_urllib_parse, attr.name, attr)
del attr

Module_six_moves_urllib_parse._moved_attributes = _urllib_parse_moved_attributes

_importer._add_module(Module_six_moves_urllib_parse(__name__ + ".moves.urllib_parse"),
"moves.urllib_parse", "moves.urllib.parse")

class Module_six_moves_urllib_error(_LazyModule):

"""Lazy loading of moved objects in six.moves.urllib_error"""

_urllib_error_moved_attributes = [
MovedAttribute("URLError", "urllib2", "urllib.error"),
MovedAttribute("HTTPError", "urllib2", "urllib.error"),
MovedAttribute("ContentTooShortError", "urllib", "urllib.error"),
]
for attr in _urllib_error_moved_attributes:
setattr(Module_six_moves_urllib_error, attr.name, attr)
del attr

E-Commerce Website 55
SEA College Of Science, Commerce and Art’s

Module_six_moves_urllib_error._moved_attributes = _urllib_error_moved_attributes

_importer._add_module(Module_six_moves_urllib_error(__name__ + ".moves.urllib.error"),
"moves.urllib_error", "moves.urllib.error")

class Module_six_moves_urllib_request(_LazyModule):

"""Lazy loading of moved objects in six.moves.urllib_request"""

_urllib_request_moved_attributes = [
MovedAttribute("urlopen", "urllib2", "urllib.request"),
MovedAttribute("install_opener", "urllib2", "urllib.request"),
MovedAttribute("build_opener", "urllib2", "urllib.request"),
MovedAttribute("pathname2url", "urllib", "urllib.request"),
MovedAttribute("url2pathname", "urllib", "urllib.request"),
MovedAttribute("getproxies", "urllib", "urllib.request"),
MovedAttribute("Request", "urllib2", "urllib.request"),
MovedAttribute("OpenerDirector", "urllib2", "urllib.request"),
MovedAttribute("HTTPDefaultErrorHandler", "urllib2", "urllib.request"),
MovedAttribute("HTTPRedirectHandler", "urllib2", "urllib.request"),
MovedAttribute("HTTPCookieProcessor", "urllib2", "urllib.request"),
MovedAttribute("ProxyHandler", "urllib2", "urllib.request"),
MovedAttribute("BaseHandler", "urllib2", "urllib.request"),
MovedAttribute("HTTPPasswordMgr", "urllib2", "urllib.request"),
MovedAttribute("HTTPPasswordMgrWithDefaultRealm", "urllib2", "urllib.request"),
MovedAttribute("AbstractBasicAuthHandler", "urllib2", "urllib.request"),
MovedAttribute("HTTPBasicAuthHandler", "urllib2", "urllib.request"),
MovedAttribute("ProxyBasicAuthHandler", "urllib2", "urllib.request"),
MovedAttribute("AbstractDigestAuthHandler", "urllib2", "urllib.request"),
MovedAttribute("HTTPDigestAuthHandler", "urllib2", "urllib.request"),
MovedAttribute("ProxyDigestAuthHandler", "urllib2", "urllib.request"),
MovedAttribute("HTTPHandler", "urllib2", "urllib.request"),
MovedAttribute("HTTPSHandler", "urllib2", "urllib.request"),
MovedAttribute("FileHandler", "urllib2", "urllib.request"),
MovedAttribute("FTPHandler", "urllib2", "urllib.request"),
MovedAttribute("CacheFTPHandler", "urllib2", "urllib.request"),
MovedAttribute("UnknownHandler", "urllib2", "urllib.request"),
MovedAttribute("HTTPErrorProcessor", "urllib2", "urllib.request"),
MovedAttribute("urlretrieve", "urllib", "urllib.request"),
MovedAttribute("urlcleanup", "urllib", "urllib.request"),
MovedAttribute("URLopener", "urllib", "urllib.request"),
MovedAttribute("FancyURLopener", "urllib", "urllib.request"),
MovedAttribute("proxy_bypass", "urllib", "urllib.request"),
MovedAttribute("parse_http_list", "urllib2", "urllib.request"),
MovedAttribute("parse_keqv_list", "urllib2", "urllib.request"),
]
for attr in _urllib_request_moved_attributes:
setattr(Module_six_moves_urllib_request, attr.name, attr)
del attr

Module_six_moves_urllib_request._moved_attributes = _urllib_request_moved_attributes

_importer._add_module(Module_six_moves_urllib_request(__name__ + ".moves.urllib.request"),
"moves.urllib_request", "moves.urllib.request")

class Module_six_moves_urllib_response(_LazyModule):

"""Lazy loading of moved objects in six.moves.urllib_response"""

_urllib_response_moved_attributes = [
MovedAttribute("addbase", "urllib", "urllib.response"),
MovedAttribute("addclosehook", "urllib", "urllib.response"),
MovedAttribute("addinfo", "urllib", "urllib.response"),
MovedAttribute("addinfourl", "urllib", "urllib.response"),
]
for attr in _urllib_response_moved_attributes:
setattr(Module_six_moves_urllib_response, attr.name, attr)
del attr

Module_six_moves_urllib_response._moved_attributes = _urllib_response_moved_attributes

_importer._add_module(Module_six_moves_urllib_response(__name__ + ".moves.urllib.response"),
"moves.urllib_response", "moves.urllib.response")

E-Commerce Website 56
SEA College Of Science, Commerce and Art’s

class Module_six_moves_urllib_robotparser(_LazyModule):

"""Lazy loading of moved objects in six.moves.urllib_robotparser"""

_urllib_robotparser_moved_attributes = [
MovedAttribute("RobotFileParser", "robotparser", "urllib.robotparser"),
]
for attr in _urllib_robotparser_moved_attributes:
setattr(Module_six_moves_urllib_robotparser, attr.name, attr)
del attr

Module_six_moves_urllib_robotparser._moved_attributes = _urllib_robotparser_moved_attributes

_importer._add_module(Module_six_moves_urllib_robotparser(__name__ +
".moves.urllib.robotparser"),
"moves.urllib_robotparser", "moves.urllib.robotparser")

class Module_six_moves_urllib(types.ModuleType):

"""Create a six.moves.urllib namespace that resembles the Python 3 namespace"""


__path__ = [] # mark as package
parse = _importer._get_module("moves.urllib_parse")
error = _importer._get_module("moves.urllib_error")
request = _importer._get_module("moves.urllib_request")
response = _importer._get_module("moves.urllib_response")
robotparser = _importer._get_module("moves.urllib_robotparser")

def __dir__(self):
return ['parse', 'error', 'request', 'response', 'robotparser']

_importer._add_module(Module_six_moves_urllib(__name__ + ".moves.urllib"),
"moves.urllib")

def add_move(move):
"""Add an item to six.moves."""
setattr(_MovedItems, move.name, move)

def remove_move(name):
"""Remove item from six.moves."""
try:
delattr(_MovedItems, name)
except AttributeError:
try:
del moves.__dict__[name]
except KeyError:
raise AttributeError("no such move, %r" % (name,))

if PY3:
_meth_func = "__func__"
_meth_self = "__self__"

_func_closure = "__closure__"
_func_code = "__code__"
_func_defaults = "__defaults__"
_func_globals = "__globals__"
else:
_meth_func = "im_func"
_meth_self = "im_self"

_func_closure = "func_closure"
_func_code = "func_code"
_func_defaults = "func_defaults"
_func_globals = "func_globals"

try:
advance_iterator = next
except NameError:
def advance_iterator(it):
return it.next()
next = advance_iterator

try:
callable = callable
except NameError:

E-Commerce Website 57
SEA College Of Science, Commerce and Art’s

def callable(obj):
return any("__call__" in klass.__dict__ for klass in type(obj).__mro__)

if PY3:
def get_unbound_function(unbound):
return unbound

create_bound_method = types.MethodType

def create_unbound_method(func, cls):


return func

Iterator = object
else:
def get_unbound_function(unbound):
return unbound.im_func

def create_bound_method(func, obj):


return types.MethodType(func, obj, obj.__class__)

def create_unbound_method(func, cls):


return types.MethodType(func, None, cls)

class Iterator(object):

def next(self):
return type(self).__next__(self)

callable = callable
_add_doc(get_unbound_function,
"""Get the function out of a possibly unbound function""")

get_method_function = operator.attrgetter(_meth_func)
get_method_self = operator.attrgetter(_meth_self)
get_function_closure = operator.attrgetter(_func_closure)
get_function_code = operator.attrgetter(_func_code)
get_function_defaults = operator.attrgetter(_func_defaults)
get_function_globals = operator.attrgetter(_func_globals)

if PY3:
def iterkeys(d, **kw):
return iter(d.keys(**kw))

def itervalues(d, **kw):


return iter(d.values(**kw))

def iteritems(d, **kw):


return iter(d.items(**kw))

def iterlists(d, **kw):


return iter(d.lists(**kw))

viewkeys = operator.methodcaller("keys")

viewvalues = operator.methodcaller("values")

viewitems = operator.methodcaller("items")
else:
def iterkeys(d, **kw):
return d.iterkeys(**kw)

def itervalues(d, **kw):


return d.itervalues(**kw)

def iteritems(d, **kw):


return d.iteritems(**kw)

def iterlists(d, **kw):


return d.iterlists(**kw)

viewkeys = operator.methodcaller("viewkeys")

viewvalues = operator.methodcaller("viewvalues")

E-Commerce Website 58
SEA College Of Science, Commerce and Art’s

viewitems = operator.methodcaller("viewitems")

_add_doc(iterkeys, "Return an iterator over the keys of a dictionary.")


_add_doc(itervalues, "Return an iterator over the values of a dictionary.")
_add_doc(iteritems,
"Return an iterator over the (key, value) pairs of a dictionary.")
_add_doc(iterlists,
"Return an iterator over the (key, [values]) pairs of a dictionary.")

if PY3:
def b(s):
return s.encode("latin-1")

def u(s):
return s
unichr = chr
import struct
int2byte = struct.Struct(">B").pack
del struct
byte2int = operator.itemgetter(0)
indexbytes = operator.getitem
iterbytes = iter
import io
StringIO = io.StringIO
BytesIO = io.BytesIO
del io
_assertCountEqual = "assertCountEqual"
if sys.version_info[1] <= 1:
_assertRaisesRegex = "assertRaisesRegexp"
_assertRegex = "assertRegexpMatches"
_assertNotRegex = "assertNotRegexpMatches"
else:
_assertRaisesRegex = "assertRaisesRegex"
_assertRegex = "assertRegex"
_assertNotRegex = "assertNotRegex"
else:
def b(s):
return s
# Workaround for standalone backslash

def u(s):
return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape")
unichr = unichr
int2byte = chr

def byte2int(bs):
return ord(bs[0])

def indexbytes(buf, i):


return ord(buf[i])
iterbytes = functools.partial(itertools.imap, ord)
import StringIO
StringIO = BytesIO = StringIO.StringIO
_assertCountEqual = "assertItemsEqual"
_assertRaisesRegex = "assertRaisesRegexp"
_assertRegex = "assertRegexpMatches"
_assertNotRegex = "assertNotRegexpMatches"
_add_doc(b, """Byte literal""")
_add_doc(u, """Text literal""")

def assertCountEqual(self, *args, **kwargs):


return getattr(self, _assertCountEqual)(*args, **kwargs)

def assertRaisesRegex(self, *args, **kwargs):


return getattr(self, _assertRaisesRegex)(*args, **kwargs)

def assertRegex(self, *args, **kwargs):


return getattr(self, _assertRegex)(*args, **kwargs)

def assertNotRegex(self, *args, **kwargs):


return getattr(self, _assertNotRegex)(*args, **kwargs)

if PY3:
exec_ = getattr(moves.builtins, "exec")

E-Commerce Website 59
SEA College Of Science, Commerce and Art’s

def reraise(tp, value, tb=None):


try:
if value is None:
value = tp()
if value.__traceback__ is not tb:
raise value.with_traceback(tb)
raise value
finally:
value = None
tb = None

else:
def exec_(_code_, _globs_=None, _locs_=None):
"""Execute code in a namespace."""
if _globs_ is None:
frame = sys._getframe(1)
_globs_ = frame.f_globals
if _locs_ is None:
_locs_ = frame.f_locals
del frame
elif _locs_ is None:
_locs_ = _globs_
exec("""exec _code_ in _globs_, _locs_""")

exec_("""def reraise(tp, value, tb=None):


try:
raise tp, value, tb
finally:
tb = None
""")

if sys.version_info[:2] > (3,):


exec_("""def raise_from(value, from_value):
try:
raise value from from_value
finally:
value = None
""")
else:
def raise_from(value, from_value):
raise value

print_ = getattr(moves.builtins, "print", None)


if print_ is None:
def print_(*args, **kwargs):
"""The new-style print function for Python 2.4 and 2.5."""
fp = kwargs.pop("file", sys.stdout)
if fp is None:
return

def write(data):
if not isinstance(data, basestring):
data = str(data)
# If the file has an encoding, encode unicode with it.
if (isinstance(fp, file) and
isinstance(data, unicode) and
fp.encoding is not None):
errors = getattr(fp, "errors", None)
if errors is None:
errors = "strict"
data = data.encode(fp.encoding, errors)
fp.write(data)
want_unicode = False
sep = kwargs.pop("sep", None)
if sep is not None:
if isinstance(sep, unicode):
want_unicode = True
elif not isinstance(sep, str):
raise TypeError("sep must be None or a string")
end = kwargs.pop("end", None)
if end is not None:
if isinstance(end, unicode):
want_unicode = True
elif not isinstance(end, str):

E-Commerce Website 60
SEA College Of Science, Commerce and Art’s

raise TypeError("end must be None or a string")


if kwargs:
raise TypeError("invalid keyword arguments to print()")
if not want_unicode:
for arg in args:
if isinstance(arg, unicode):
want_unicode = True
break
if want_unicode:
newline = unicode("\n")
space = unicode(" ")
else:
newline = "\n"
space = " "
if sep is None:
sep = space
if end is None:
end = newline
for i, arg in enumerate(args):
if i:
write(sep)
write(arg)
write(end)
if sys.version_info[:2] < (3, 3):
_print = print_

def print_(*args, **kwargs):


fp = kwargs.get("file", sys.stdout)
flush = kwargs.pop("flush", False)
_print(*args, **kwargs)
if flush and fp is not None:
fp.flush()

_add_doc(reraise, """Reraise an exception.""")

if sys.version_info[0:2] < (3, 4):


def _update_wrapper(wrapper, wrapped,
assigned=functools.WRAPPER_ASSIGNMENTS,
updated=functools.WRAPPER_UPDATES):
for attr in assigned:
try:
value = getattr(wrapped, attr)
except AttributeError:
continue
else:
setattr(wrapper, attr, value)
for attr in updated:
getattr(wrapper, attr).update(getattr(wrapped, attr, {}))
wrapper.__wrapped__ = wrapped
return wrapper
_update_wrapper.__doc__ = functools.update_wrapper.__doc__

def wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS,


updated=functools.WRAPPER_UPDATES):
return functools.partial(_update_wrapper, wrapped=wrapped,
assigned=assigned, updated=updated)
wraps.__doc__ = functools.wraps.__doc__

else:
wraps = functools.wraps

def with_metaclass(meta, *bases):


class metaclass(type):

def __new__(cls, name, this_bases, d):


if sys.version_info[:2] >= (3, 7):
# This version introduced PEP 560 that requires a bit
# of extra care (we mimic what is done by __build_class__).
resolved_bases = types.resolve_bases(bases)
if resolved_bases is not bases:
d['__orig_bases__'] = bases
else:
resolved_bases = bases
return meta(name, resolved_bases, d)

E-Commerce Website 61
SEA College Of Science, Commerce and Art’s

@classmethod
def __prepare__(cls, name, this_bases):
return meta.__prepare__(name, bases)
return type.__new__(metaclass, 'temporary_class', (), {})

def add_metaclass(metaclass):
"""Class decorator for creating a class with a metaclass."""
def wrapper(cls):
orig_vars = cls.__dict__.copy()
slots = orig_vars.get('__slots__')
if slots is not None:
if isinstance(slots, str):
slots = [slots]
for slots_var in slots:
orig_vars.pop(slots_var)
orig_vars.pop('__dict__', None)
orig_vars.pop('__weakref__', None)
if hasattr(cls, '__qualname__'):
orig_vars['__qualname__'] = cls.__qualname__
return metaclass(cls.__name__, cls.__bases__, orig_vars)
return wrapper

def ensure_binary(s, encoding='utf-8', errors='strict'):


"""Coerce **s** to six.binary_type.

For Python 2:
- `unicode` -> encoded to `str`
- `str` -> `str`

For Python 3:
- `str` -> encoded to `bytes`
- `bytes` -> `bytes`
"""
if isinstance(s, binary_type):
return s
if isinstance(s, text_type):
return s.encode(encoding, errors)
raise TypeError("not expecting type '%s'" % type(s))

def ensure_str(s, encoding='utf-8', errors='strict'):


"""Coerce *s* to `str`.

For Python 2:
- `unicode` -> encoded to `str`
- `str` -> `str`

For Python 3:
- `str` -> `str`
- `bytes` -> decoded to `str`
"""
# Optimization: Fast return for the common case.
if type(s) is str:
return s
if PY2 and isinstance(s, text_type):
return s.encode(encoding, errors)
elif PY3 and isinstance(s, binary_type):
return s.decode(encoding, errors)
elif not isinstance(s, (text_type, binary_type)):
raise TypeError("not expecting type '%s'" % type(s))
return s

def ensure_text(s, encoding='utf-8', errors='strict'):


"""Coerce *s* to six.text_type.

For Python 2:
- `unicode` -> `unicode`
- `str` -> `unicode`

For Python 3:
- `str` -> `str`
- `bytes` -> decoded to `str`
"""
if isinstance(s, binary_type):
return s.decode(encoding, errors)

E-Commerce Website 62
SEA College Of Science, Commerce and Art’s

elif isinstance(s, text_type):


return s
else:
raise TypeError("not expecting type '%s'" % type(s))

def python_2_unicode_compatible(klass):
"""
A class decorator that defines __unicode__ and __str__ methods under Python 2.
Under Python 3 it does nothing.

To support Python 2 and 3 with a single code base, define a __str__ method
returning text and apply this decorator to the class.
"""
if PY2:
if '__str__' not in klass.__dict__:
raise ValueError("@python_2_unicode_compatible cannot be applied "
"to %s because it doesn't define __str__()." %
klass.__name__)
klass.__unicode__ = klass.__str__
klass.__str__ = lambda self: self.__unicode__().encode('utf-8')
return klass

if globals().get("__spec__") is not None:


__spec__.submodule_search_locations = [] # PEP 451 @UndefinedVariable
if sys.meta_path:
for i, importer in enumerate(sys.meta_path):

if (type(importer).__name__ == "_SixMetaPathImporter" and


importer.name == __name__):
del sys.meta_path[i]
break
del i, importer
# Finally, add the importer to the meta path import hook.
sys.meta_path.append(_importer)

# This file must be used with "source bin/activate" *from bash*


# you cannot run it directly

deactivate () {
# reset old environment variables
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
PATH="${_OLD_VIRTUAL_PATH:-}"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi

# past commands the $PATH changes we made may not be respected


if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r 2> /dev/null
fi

if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
PS1="${_OLD_VIRTUAL_PS1:-}"
export PS1
unset _OLD_VIRTUAL_PS1
fi

unset VIRTUAL_ENV
unset VIRTUAL_ENV_PROMPT
if [ ! "${1:-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}

# unset irrelevant variables


deactivate nondestructive

E-Commerce Website 63
SEA College Of Science, Commerce and Art’s

VIRTUAL_ENV="C:\Users\amalj\django_ecomerce_MVT\env"
export VIRTUAL_ENV

_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/Scripts:$PATH"
export PATH

# unset PYTHONHOME if set


# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
# could use `if (set -u; : $PYTHONHOME) ;` in bash
if [ -n "${PYTHONHOME:-}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
unset PYTHONHOME
fi

if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1:-}"
PS1="(env) ${PS1:-}"
export PS1
VIRTUAL_ENV_PROMPT="(env) "
export VIRTUAL_ENV_PROMPT
fi

# past commands the $PATH changes we made may not be respected


if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r 2> /dev/null
fi

# This file must be used with "source bin/activate" *from bash*


# you cannot run it directly

deactivate () {
# reset old environment variables
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
PATH="${_OLD_VIRTUAL_PATH:-}"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi

if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then


hash -r 2> /dev/null
fi

if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
PS1="${_OLD_VIRTUAL_PS1:-}"
export PS1
unset _OLD_VIRTUAL_PS1
fi

unset VIRTUAL_ENV
unset VIRTUAL_ENV_PROMPT
if [ ! "${1:-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}

# unset irrelevant variables


deactivate nondestructive

VIRTUAL_ENV="C:\Users\amalj\django_ecomerce_MVT\env"
export VIRTUAL_ENV

_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/Scripts:$PATH"
export PATH

# unset PYTHONHOME if set


# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)

E-Commerce Website 64
SEA College Of Science, Commerce and Art’s

# could use `if (set -u; : $PYTHONHOME) ;` in bash


if [ -n "${PYTHONHOME:-}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
unset PYTHONHOME
fi

if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1:-}"
PS1="(env) ${PS1:-}"
export PS1
VIRTUAL_ENV_PROMPT="(env) "
export VIRTUAL_ENV_PROMPT
fi

hash -r 2> /dev/null


fi

"""
Activate virtualenv for current interpreter:

Use exec(open(this_file).read(), {'__file__': this_file}).

This can be used when you must use an existing Python interpreter, not the virtualenv
bin/python.
""" # noqa: D415
from __future__ import annotations

import os
import site
import sys

try:
abs_file = os.path.abspath(__file__)
except NameError as exc:
msg = "You must use exec(open(this_file).read(), {'__file__': this_file}))"
raise AssertionError(msg) from exc

bin_dir = os.path.dirname(abs_file)
base = bin_dir[: -len("Scripts") - 1] # strip away the bin part from the __file__, plus the
path separator

# prepend bin to PATH (this file is inside the bin directory)


os.environ["PATH"] = os.pathsep.join([bin_dir, *os.environ.get("PATH", "").split(os.pathsep)])
os.environ["VIRTUAL_ENV"] = base # virtual env is right above bin directory
os.environ["VIRTUAL_ENV_PROMPT"] = "" or os.path.basename(base) # noqa: SIM222

# add the virtual environments libraries to the host python import mechanism
prev_length = len(sys.path)
for lib in "..\\Lib\\site-packages".split(os.pathsep):
path = os.path.realpath(os.path.join(bin_dir, lib))
site.addsitedir(path.decode("utf-8") if "" else path)
sys.path[:] = sys.path[prev_length:] + sys.path[0:prev_length]

sys.real_prefix = sys.prefix
sys.prefix = base

@echo off

rem This file is UTF-8 encoded, so we need to update the current code page while executing it
for /f "tokens=2 delims=:." %%a in ('"%SystemRoot%\System32\chcp.com"') do (
set _OLD_CODEPAGE=%%a
)
if defined _OLD_CODEPAGE (
"%SystemRoot%\System32\chcp.com" 65001 > nul
)

set VIRTUAL_ENV=C:\Users\amalj\django_ecomerce_MVT\env

if not defined PROMPT set PROMPT=$P$G

if defined _OLD_VIRTUAL_PROMPT set PROMPT=%_OLD_VIRTUAL_PROMPT%


if defined _OLD_VIRTUAL_PYTHONHOME set PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%

set _OLD_VIRTUAL_PROMPT=%PROMPT%

E-Commerce Website 65
SEA College Of Science, Commerce and Art’s

set PROMPT=(env) %PROMPT%

if defined PYTHONHOME set _OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%


set PYTHONHOME=

if defined _OLD_VIRTUAL_PATH set PATH=%_OLD_VIRTUAL_PATH%


if not defined _OLD_VIRTUAL_PATH set _OLD_VIRTUAL_PATH=%PATH%

set PATH=%VIRTUAL_ENV%\Scripts;%PATH%
set VIRTUAL_ENV_PROMPT=(env)

:END
if defined _OLD_CODEPAGE (
"%SystemRoot%\System32\chcp.com" %_OLD_CODEPAGE% > nul
set _OLD_CODEPAGE=
)

# This file must be used using `source bin/activate.fish` *within a running fish (
http://fishshell.com ) session*.
# Do not run it directly.

function _bashify_path -d "Converts a fish path to something bash can recognize"


set fishy_path $argv
set bashy_path $fishy_path[1]
for path_part in $fishy_path[2..-1]
set bashy_path "$bashy_path:$path_part"
end
echo $bashy_path
end

function _fishify_path -d "Converts a bash path to something fish can recognize"


echo $argv | tr ':' '\n'
end

function deactivate -d 'Exit virtualenv mode and return to the normal environment.'
# reset old environment variables
if test -n "$_OLD_VIRTUAL_PATH"
# https://github.com/fish-shell/fish-shell/issues/436 altered PATH handling
if test (echo $FISH_VERSION | head -c 1) -lt 3
set -gx PATH (_fishify_path "$_OLD_VIRTUAL_PATH")
else
set -gx PATH $_OLD_VIRTUAL_PATH
end
set -e _OLD_VIRTUAL_PATH
end

if test -n "$_OLD_VIRTUAL_PYTHONHOME"
set -gx PYTHONHOME "$_OLD_VIRTUAL_PYTHONHOME"
set -e _OLD_VIRTUAL_PYTHONHOME
end

if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
and functions -q _old_fish_prompt
# Set an empty local `$fish_function_path` to allow the removal of `fish_prompt` using
`functions -e`.
set -l fish_function_path

# Erase virtualenv's `fish_prompt` and restore the original.


functions -e fish_prompt
functions -c _old_fish_prompt fish_prompt
functions -e _old_fish_prompt
set -e _OLD_FISH_PROMPT_OVERRIDE
end

set -e VIRTUAL_ENV
set -e VIRTUAL_ENV_PROMPT

if test "$argv[1]" != 'nondestructive'


# Self-destruct!
functions -e pydoc
functions -e deactivate
functions -e _bashify_path
functions -e _fishify_path
end
end

E-Commerce Website 66
SEA College Of Science, Commerce and Art’s

deactivate nondestructive

set -gx VIRTUAL_ENV 'C:\Users\amalj\django_ecomerce_MVT\env'

if test (echo $FISH_VERSION | head -c 1) -lt 3


set -gx _OLD_VIRTUAL_PATH (_bashify_path $PATH)
else
set -gx _OLD_VIRTUAL_PATH $PATH
end
set -gx PATH "$VIRTUAL_ENV"'/Scripts' $PATH

if test -n ''
set -gx VIRTUAL_ENV_PROMPT ''
else
set -gx VIRTUAL_ENV_PROMPT (basename "$VIRTUAL_ENV")
end

if set -q PYTHONHOME
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
set -e PYTHONHOME
end

function pydoc
python -m pydoc $argv
end

if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"

functions -c fish_prompt _old_fish_prompt

function fish_prompt

set -l prompt (_old_fish_prompt)

printf '(%s) ' $VIRTUAL_ENV_PROMPT

string join -- \n $prompt


end

set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"


end

export-env {
def is-string [x] {
($x | describe) == 'string'
}

def has-env [...names] {


$names | each {|n|
$n in $env
} | all {|i| $i == true}
}

def is-env-true [name: string] {


if (has-env $name) {
# Try to parse 'true', '0', '1', and fail if not convertible
let parsed = (do -i { $env | get $name | into bool })
if ($parsed | describe) == 'bool' {
$parsed
} else {
not ($env | get -i $name | is-empty)
}
} else {
false
}
}

let virtual_env = 'C:\Users\amalj\django_ecomerce_MVT\env'


let bin = 'Scripts'

let is_windows = ($nu.os-info.family) == 'windows'

E-Commerce Website 67
SEA College Of Science, Commerce and Art’s

let path_name = (if (has-env 'Path') {


'Path'
} else {
'PATH'
}
)

let venv_path = ([$virtual_env $bin] | path join)


let new_path = ($env | get $path_name | prepend $venv_path)

let virtual_env_prompt = (if ('' | is-empty) {


($virtual_env | path basename)
} else {
''
})

let new_env = {
$path_name : $new_path
VIRTUAL_ENV : $virtual_env
VIRTUAL_ENV_PROMPT : $virtual_env_prompt
}

let new_env = (if (is-env-true 'VIRTUAL_ENV_DISABLE_PROMPT') {


$new_env
} else {
let virtual_prefix = $'(char lparen)($virtual_env_prompt)(char rparen) '

let old_prompt_command = (if (has-env 'PROMPT_COMMAND') {


$env.PROMPT_COMMAND
} else {
''
})

let new_prompt = (if (has-env 'PROMPT_COMMAND') {


if 'closure' in ($old_prompt_command | describe) {
{|| $'($virtual_prefix)(do $old_prompt_command)' }
} else {
{|| $'($virtual_prefix)($old_prompt_command)' }
}
} else {
{|| $'($virtual_prefix)' }
})

$new_env | merge {
PROMPT_COMMAND : $new_prompt
VIRTUAL_PREFIX : $virtual_prefix
}
})

# Environment variables that will be loaded as the virtual env


load-env $new_env
}

export alias pydoc = python -m pydoc


export alias deactivate = overlay hide activate
@echo off

if defined _OLD_VIRTUAL_PROMPT (
set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
)
set _OLD_VIRTUAL_PROMPT=

if defined _OLD_VIRTUAL_PYTHONHOME (
set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
set _OLD_VIRTUAL_PYTHONHOME=
)

if defined _OLD_VIRTUAL_PATH (
set "PATH=%_OLD_VIRTUAL_PATH%"
)

set _OLD_VIRTUAL_PATH=

E-Commerce Website 68
SEA College Of Science, Commerce and Art’s

set VIRTUAL_ENV=
set VIRTUAL_ENV_PROMPT=

:END

Order

# Generated by Django 3.1 on 2023-08-24 02:25

from django.conf import settings


from django.db import migrations, models
import django.db.models.deletion

class Migration(migrations.Migration):

initial = True

dependencies = [
('shop', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='Order',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False,
verbose_name='ID')),
('order_number', models.CharField(max_length=20)),
('first_name', models.CharField(max_length=50)),
('last_name', models.CharField(max_length=50)),
('phone', models.CharField(max_length=15)),
('email', models.EmailField(max_length=50)),
('address_line_1', models.CharField(max_length=50)),
('address_line_2', models.CharField(blank=True, max_length=50)),
('country', models.CharField(max_length=50)),
('state', models.CharField(max_length=50)),
('city', models.CharField(max_length=50)),
('order_note', models.CharField(blank=True, max_length=100)),
('order_total', models.FloatField()),
('tax', models.FloatField()),
('status', models.CharField(choices=[('New', 'New'), ('Accepted', 'Accepted'),
('Completed', 'Completed'), ('Cancelled', 'Cancelled')], default='New', max_length=10)),
('ip', models.CharField(blank=True, max_length=20)),
('is_ordered', models.BooleanField(default=False)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
),
migrations.CreateModel(
name='Payment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False,
verbose_name='ID')),
('payment_id', models.CharField(max_length=100)),
('payment_method', models.CharField(max_length=100)),
('amount_paid', models.CharField(max_length=100)),
('status', models.CharField(max_length=100)),
('created_at', models.DateTimeField(auto_now_add=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='OrderProduct',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False,
verbose_name='ID')),
('quantity', models.IntegerField()),
('product_price', models.FloatField()),
('ordered', models.BooleanField(default=False)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),

E-Commerce Website 69
SEA College Of Science, Commerce and Art’s

('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
to='orders.order')),
('payment', models.ForeignKey(blank=True, null=True,
on_delete=django.db.models.deletion.SET_NULL, to='orders.payment')),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
to='shop.product')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL)),
('variations', models.ManyToManyField(blank=True, to='shop.Variation')),
],
),
migrations.AddField(
model_name='order',
name='payment',
field=models.ForeignKey(blank=True, null=True,
on_delete=django.db.models.deletion.SET_NULL, to='orders.payment'),
),
migrations.AddField(
model_name='order',
name='user',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL,
to=settings.AUTH_USER_MODEL),
),
]

from django.contrib import admin


from .models import Payment, Order, OrderProduct
# Register your models here.

class OrderProductInline(admin.TabularInline):
model = OrderProduct
readonly_fields = ('payment', 'user', 'product', 'quantity', 'product_price', 'ordered')
extra = 0

class OrderAdmin(admin.ModelAdmin):
list_display = ['order_number', 'full_name', 'phone', 'email', 'city', 'order_total', 'tax',
'status', 'is_ordered', 'created_at']
list_filter = ['status', 'is_ordered']
search_fields = ['order_number', 'first_name', 'last_name', 'phone', 'email']
list_per_page = 20
inlines = [OrderProductInline]

admin.site.register(Payment)
admin.site.register(Order, OrderAdmin)
admin.site.register(OrderProduct)
from django.apps import AppConfig

class OrdersConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'orders'

from django import forms


from .models import Order

class OrderForm(forms.ModelForm):
class Meta:
model = Order
fields = ['first_name', 'last_name', 'phone', 'email', 'address_line_1',
'address_line_2', 'country', 'state', 'city', 'order_note']
from django.db import models
from accounts.models import Account
from shop.models import Product, Variation

class Payment(models.Model):
user = models.ForeignKey(Account, on_delete=models.CASCADE)
payment_id = models.CharField(max_length=100)
payment_method = models.CharField(max_length=100)
amount_paid = models.CharField(max_length=100) # this is the total amount paid
status = models.CharField(max_length=100)
created_at = models.DateTimeField(auto_now_add=True)

def __str__(self):
return self.payment_id

E-Commerce Website 70
SEA College Of Science, Commerce and Art’s

class Order(models.Model):
STATUS = (
('New', 'New'),
('Accepted', 'Accepted'),
('Completed', 'Completed'),
('Cancelled', 'Cancelled'),
)

user = models.ForeignKey(Account, on_delete=models.SET_NULL, null=True)


payment = models.ForeignKey(Payment, on_delete=models.SET_NULL, blank=True, null=True)
order_number = models.CharField(max_length=20)
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
phone = models.CharField(max_length=15)
email = models.EmailField(max_length=50)
address_line_1 = models.CharField(max_length=50)
address_line_2 = models.CharField(max_length=50, blank=True)
country = models.CharField(max_length=50)
state = models.CharField(max_length=50)
city = models.CharField(max_length=50)
order_note = models.CharField(max_length=100, blank=True)
order_total = models.FloatField()
tax = models.FloatField()
status = models.CharField(max_length=10, choices=STATUS, default='New')
ip = models.CharField(blank=True, max_length=20)
is_ordered = models.BooleanField(default=False)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)

def full_name(self):
return f'{self.first_name} {self.last_name}'

def full_address(self):
return f'{self.address_line_1} {self.address_line_2}'

def __str__(self):
return self.first_name

class OrderProduct(models.Model):
order = models.ForeignKey(Order, on_delete=models.CASCADE)
payment = models.ForeignKey(Payment, on_delete=models.SET_NULL, blank=True, null=True)
user = models.ForeignKey(Account, on_delete=models.CASCADE)
product = models.ForeignKey(Product, on_delete=models.CASCADE)
variations = models.ManyToManyField(Variation, blank=True)
quantity = models.IntegerField()
product_price = models.FloatField()
ordered = models.BooleanField(default=False)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)

def __str__(self):
return self.product.product_name

from django.urls import path


from . import views

urlpatterns = [
path('place_order/', views.place_order, name='place_order'),
path('payments/', views.payments, name='payments'),
path('order_complete/', views.order_complete, name='order_complete'),
]
from django.shortcuts import render, redirect
from django.http import HttpResponse, JsonResponse
from cart.models import CartItem
from .forms import OrderForm
import datetime
from .models import Order, Payment, OrderProduct
import json
from shop.models import Product
from django.core.mail import EmailMessage
from django.template.loader import render_to_string

def payments(request):
body = json.loads(request.body)

E-Commerce Website 71
SEA College Of Science, Commerce and Art’s

order = Order.objects.get(user=request.user, is_ordered=False, order_number=body['orderID'])

# Store transaction details inside Payment model


payment = Payment(
user = request.user,
payment_id = body['transID'],
payment_method = body['payment_method'],
amount_paid = order.order_total,
status = body['status'],
)
payment.save()

order.payment = payment
order.is_ordered = True
order.save()

# Move the cart items to Order Product table


cart_items = CartItem.objects.filter(user=request.user)

for item in cart_items:


orderproduct = OrderProduct()
orderproduct.order_id = order.id
orderproduct.payment = payment
orderproduct.user_id = request.user.id
orderproduct.product_id = item.product_id
orderproduct.quantity = item.quantity
orderproduct.product_price = item.product.price
orderproduct.ordered = True
orderproduct.save()

cart_item = CartItem.objects.get(id=item.id)
product_variation = cart_item.variations.all()
orderproduct = OrderProduct.objects.get(id=orderproduct.id)
orderproduct.variations.set(product_variation)
orderproduct.save()

# Reduce the quantity of the sold products


product = Product.objects.get(id=item.product_id)
product.stock -= item.quantity
product.save()

# Clear cart
CartItem.objects.filter(user=request.user).delete()

# Send order recieved email to customer


mail_subject = 'Thank you for your order!'
message = render_to_string('orders/order_recieved_email.html', {
'user': request.user,
'order': order,
})
to_email = request.user.email
send_email = EmailMessage(mail_subject, message, to=[to_email])
send_email.send()

# Send order number and transaction id back to sendData method via JsonResponse
data = {
'order_number': order.order_number,
'transID': payment.payment_id,
}
return JsonResponse(data)

def place_order(request, total=0, quantity=0,):


current_user = request.user

# If the cart count is less than or equal to 0, then redirect back to shop
cart_items = CartItem.objects.filter(user=current_user)
cart_count = cart_items.count()
if cart_count <= 0:
return redirect('shop')

grand_total = 0
tax = 0
for cart_item in cart_items:
total += (cart_item.product.price * cart_item.quantity)

E-Commerce Website 72
SEA College Of Science, Commerce and Art’s

quantity += cart_item.quantity
tax = (2 * total)/100
grand_total = total + tax

if request.method == 'POST':
form = OrderForm(request.POST)
if form.is_valid():
# Store all the billing information inside Order table
data = Order()
data.user = current_user
data.first_name = form.cleaned_data['first_name']
data.last_name = form.cleaned_data['last_name']
data.phone = form.cleaned_data['phone']
data.email = form.cleaned_data['email']
data.address_line_1 = form.cleaned_data['address_line_1']
data.address_line_2 = form.cleaned_data['address_line_2']
data.country = form.cleaned_data['country']
data.state = form.cleaned_data['state']
data.city = form.cleaned_data['city']
data.order_note = form.cleaned_data['order_note']
data.order_total = grand_total
data.tax = tax
data.ip = request.META.get('REMOTE_ADDR')
data.save()
# Generate order number
yr = int(datetime.date.today().strftime('%Y'))
dt = int(datetime.date.today().strftime('%d'))
mt = int(datetime.date.today().strftime('%m'))
d = datetime.date(yr,mt,dt)
current_date = d.strftime("%Y%m%d") #20210305
order_number = current_date + str(data.id)
data.order_number = order_number
data.save()

order = Order.objects.get(user=current_user, is_ordered=False,


order_number=order_number)
context = {
'order': order,
'cart_items': cart_items,
'total': total,
'tax': tax,
'grand_total': grand_total,
}
return render(request, 'orders/payments.html', context)
else:
return redirect('checkout')

def order_complete(request):
order_number = request.GET.get('order_number')
transID = request.GET.get('payment_id')

try:
order = Order.objects.get(order_number=order_number, is_ordered=True)
ordered_products = OrderProduct.objects.filter(order_id=order.id)

subtotal = 0
for i in ordered_products:
subtotal += i.product_price * i.quantity

payment = Payment.objects.get(payment_id=transID)

context = {
'order': order,
'ordered_products': ordered_products,
'order_number': order.order_number,
'transID': payment.payment_id,
'payment': payment,
'subtotal': subtotal,
}
return render(request, 'orders/order_complete.html', context)
except (Payment.DoesNotExist, Order.DoesNotExist):
return redirect('home')

Shop

E-Commerce Website 73
SEA College Of Science, Commerce and Art’s

# Generated by Django 3.1 on 2023-08-24 02:25

from django.conf import settings


from django.db import migrations, models
import django.db.models.deletion

class Migration(migrations.Migration):

initial = True

dependencies = [
('category', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='Product',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False,
verbose_name='ID')),
('product_name', models.CharField(max_length=200, unique=True)),
('slug', models.SlugField(max_length=200, unique=True)),
('description', models.TextField(blank=True, max_length=500)),
('price', models.IntegerField()),
('images', models.ImageField(upload_to='photos/products')),
('stock', models.IntegerField()),
('is_available', models.BooleanField(default=True)),
('created_date', models.DateTimeField(auto_now_add=True)),
('modified_date', models.DateTimeField(auto_now=True)),
('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
to='category.category')),
],
),
migrations.CreateModel(
name='Variation',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False,
verbose_name='ID')),
('variation_category', models.CharField(choices=[('color', 'color'), ('size',
'size')], max_length=100)),
('variation_value', models.CharField(max_length=100)),
('is_active', models.BooleanField(default=True)),
('created_date', models.DateTimeField(auto_now=True)),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
to='shop.product')),
],
),
migrations.CreateModel(
name='ReviewRating',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False,
verbose_name='ID')),
('subject', models.CharField(blank=True, max_length=100)),
('review', models.TextField(blank=True, max_length=500)),
('rating', models.FloatField()),
('ip', models.CharField(blank=True, max_length=20)),
('status', models.BooleanField(default=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
to='shop.product')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='ProductGallery',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False,
verbose_name='ID')),
('image', models.ImageField(max_length=255, upload_to='store/products')),

E-Commerce Website 74
SEA College Of Science, Commerce and Art’s

('product', models.ForeignKey(default=None,
on_delete=django.db.models.deletion.CASCADE, to='shop.product')),
],
options={
'verbose_name': 'productgallery',
'verbose_name_plural': 'product gallery',
},
),
]

from django.contrib import admin


from .models import Product, Variation, ReviewRating, ProductGallery
import admin_thumbnails

@admin_thumbnails.thumbnail('image')
class ProductGalleryInline(admin.TabularInline):
model = ProductGallery
extra = 1

class ProductAdmin(admin.ModelAdmin):
list_display = ('product_name', 'price', 'stock', 'category', 'modified_date',
'is_available')
prepopulated_fields = {'slug': ('product_name',)}
inlines = [ProductGalleryInline]

class VariationAdmin(admin.ModelAdmin):
list_display = ('product', 'variation_category', 'variation_value', 'is_active')
list_editable = ('is_active',)
list_filter = ('product', 'variation_category', 'variation_value')

admin.site.register(Product, ProductAdmin)
admin.site.register(Variation, VariationAdmin)
admin.site.register(ReviewRating)
admin.site.register(ProductGallery)
from django import forms
from .models import ReviewRating

class ReviewForm(forms.ModelForm):
class Meta:
model = ReviewRating
fields = ['subject', 'review', 'rating']
from django.db import models
from category.models import Category
from django.urls import reverse
from accounts.models import Account
from django.db.models import Avg, Count

# Create your models here.

class Product(models.Model):
product_name = models.CharField(max_length=200, unique=True)
slug = models.SlugField(max_length=200, unique=True)
description = models.TextField(max_length=500, blank=True)
price = models.IntegerField()
images = models.ImageField(upload_to='photos/products')
stock = models.IntegerField()
is_available = models.BooleanField(default=True)
category = models.ForeignKey(Category, on_delete=models.CASCADE)
created_date = models.DateTimeField(auto_now_add=True)
modified_date = models.DateTimeField(auto_now=True)

def get_url(self):
return reverse('product_detail', args=[self.category.slug, self.slug])

def __str__(self):
return self.product_name

def averageReview(self):
reviews = ReviewRating.objects.filter(product=self,
status=True).aggregate(average=Avg('rating'))
avg = 0
if reviews['average'] is not None:
avg = float(reviews['average'])
return avg

E-Commerce Website 75
SEA College Of Science, Commerce and Art’s

def countReview(self):
reviews = ReviewRating.objects.filter(product=self,
status=True).aggregate(count=Count('id'))
count = 0
if reviews['count'] is not None:
count = int(reviews['count'])
return count

class VariationManager(models.Manager):
def colors(self):
return super(VariationManager, self).filter(variation_category='color', is_active=True)

def sizes(self):
return super(VariationManager, self).filter(variation_category='size', is_active=True)

variation_category_choice = (
('color', 'color'),
('size', 'size'),
)

class Variation(models.Model):
product = models.ForeignKey(Product, on_delete=models.CASCADE)
variation_category = models.CharField(max_length=100, choices=variation_category_choice)
variation_value = models.CharField(max_length=100)
is_active = models.BooleanField(default=True)
created_date = models.DateTimeField(auto_now=True)

objects = VariationManager()

def __str__(self):
return self.variation_value

class ReviewRating(models.Model):
product = models.ForeignKey(Product, on_delete=models.CASCADE)
user = models.ForeignKey(Account, on_delete=models.CASCADE)
subject = models.CharField(max_length=100, blank=True)
review = models.TextField(max_length=500, blank=True)
rating = models.FloatField()
ip = models.CharField(max_length=20, blank=True)
status = models.BooleanField(default=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)

def __str__(self):
return self.subject

class ProductGallery(models.Model):
product = models.ForeignKey(Product, default=None, on_delete=models.CASCADE)
image = models.ImageField(upload_to='store/products', max_length=255)

def __str__(self):
return self.product.product_name

class Meta:
verbose_name = 'productgallery'
verbose_name_plural = 'product gallery'
from django.urls import path
from . import views

urlpatterns = [
path('', views.store, name='store'),
path('category/<slug:category_slug>/', views.store, name='products_by_category'),
path('category/<slug:category_slug>/<slug:product_slug>/', views.product_detail,
name='product_detail'),
path('search/', views.search, name='search'),
path('submit_review/<int:product_id>/', views.submit_review, name='submit_review'),

]
from django.shortcuts import render, get_object_or_404, redirect
from .models import Product, ReviewRating, ProductGallery
from category.models import Category
from cart.models import CartItem
from django.db.models import Q

E-Commerce Website 76
SEA College Of Science, Commerce and Art’s

from cart.views import _cart_id


from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.http import HttpResponse
from .forms import ReviewForm
from django.contrib import messages
from orders.models import OrderProduct

def store(request, category_slug=None):


categories = None
products = None

if category_slug != None:
categories = get_object_or_404(Category, slug=category_slug)
products = Product.objects.filter(category=categories, is_available=True)
paginator = Paginator(products, 1)
page = request.GET.get('page')
paged_products = paginator.get_page(page)
product_count = products.count()
else:
products = Product.objects.all().filter(is_available=True).order_by('id')
paginator = Paginator(products, 3)
page = request.GET.get('page')
paged_products = paginator.get_page(page)
product_count = products.count()

context = {
'products': paged_products,
'product_count': product_count,
}
return render(request, 'store/store.html', context)

def product_detail(request, category_slug, product_slug):


try:
single_product = Product.objects.get(category__slug=category_slug, slug=product_slug)
in_cart = CartItem.objects.filter(cart__cart_id=_cart_id(request),
product=single_product).exists()
except Exception as e:
raise e

if request.user.is_authenticated:
try:
orderproduct = OrderProduct.objects.filter(user=request.user,
product_id=single_product.id).exists()
except OrderProduct.DoesNotExist:
orderproduct = None
else:
orderproduct = None

# Get the reviews


reviews = ReviewRating.objects.filter(product_id=single_product.id, status=True)

# Get the product gallery


product_gallery = ProductGallery.objects.filter(product_id=single_product.id)

context = {
'single_product': single_product,
'in_cart' : in_cart,
'orderproduct': orderproduct,
'reviews': reviews,
'product_gallery': product_gallery,
}
return render(request, 'store/product_detail.html', context)

def search(request):
if 'keyword' in request.GET:
keyword = request.GET['keyword']
if keyword:
products = Product.objects.order_by('-
created_date').filter(Q(description__icontains=keyword) | Q(product_name__icontains=keyword))
product_count = products.count()
context = {
'products': products,
'product_count': product_count,
}

E-Commerce Website 77
SEA College Of Science, Commerce and Art’s

return render(request, 'store/store.html', context)

def submit_review(request, product_id):


url = request.META.get('HTTP_REFERER')
if request.method == 'POST':
try:
reviews = ReviewRating.objects.get(user__id=request.user.id, product__id=product_id)
form = ReviewForm(request.POST, instance=reviews)
form.save()
messages.success(request, 'Thank you! Your review has been updated.')
return redirect(url)
except ReviewRating.DoesNotExist:
form = ReviewForm(request.POST)
if form.is_valid():
data = ReviewRating()
data.subject = form.cleaned_data['subject']
data.rating = form.cleaned_data['rating']
data.review = form.cleaned_data['review']
data.ip = request.META.get('REMOTE_ADDR')
data.product_id = product_id
data.user_id = request.user.id
data.save()
messages.success(request, 'Thank you! Your review has been submitted.')
return redirect(url)

Static
.select2-container {
box-sizing: border-box;
display: inline-block;
margin: 0;
position: relative;
vertical-align: middle; }
.select2-container .select2-selection--single {
box-sizing: border-box;
cursor: pointer;
display: block;
height: 28px;
user-select: none;
-webkit-user-select: none; }
.select2-container .select2-selection--single .select2-selection__rendered {
display: block;
padding-left: 8px;
padding-right: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; }
.select2-container .select2-selection--single .select2-selection__clear {
position: relative; }
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
padding-right: 8px;
padding-left: 20px; }
.select2-container .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 32px;
user-select: none;
-webkit-user-select: none; }
.select2-container .select2-selection--multiple .select2-selection__rendered {
display: inline-block;
overflow: hidden;
padding-left: 8px;
text-overflow: ellipsis;
white-space: nowrap; }
.select2-container .select2-search--inline {
float: left; }
.select2-container .select2-search--inline .select2-search__field {
box-sizing: border-box;
border: none;
font-size: 100%;
margin-top: 5px;
padding: 0; }
.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-
button {

E-Commerce Website 78
SEA College Of Science, Commerce and Art’s

-webkit-appearance: none; }

.select2-dropdown {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
box-sizing: border-box;
display: block;
position: absolute;
left: -100000px;
width: 100%;
z-index: 1051; }

.select2-results {
display: block; }

.select2-results__options {
list-style: none;
margin: 0;
padding: 0; }

.select2-results__option {
padding: 6px;
user-select: none;
-webkit-user-select: none; }
.select2-results__option[aria-selected] {
cursor: pointer; }

.select2-container--open .select2-dropdown {
left: 0; }

.select2-container--open .select2-dropdown--above {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }

.select2-container--open .select2-dropdown--below {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0; }

.select2-search--dropdown {
display: block;
padding: 4px; }
.select2-search--dropdown .select2-search__field {
padding: 4px;
width: 100%;
box-sizing: border-box; }
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none; }
.select2-search--dropdown.select2-search--hide {
display: none; }

.select2-close-mask {
border: 0;
margin: 0;
padding: 0;
display: block;
position: fixed;
left: 0;
top: 0;
min-height: 100%;
min-width: 100%;
height: auto;
width: auto;
opacity: 0;
z-index: 99;
background-color: #fff;
filter: alpha(opacity=0); }

.select2-hidden-accessible {
border: 0 !important;
clip: rect(0 0 0 0) !important;
-webkit-clip-path: inset(50%) !important;

E-Commerce Website 79
SEA College Of Science, Commerce and Art’s

clip-path: inset(50%) !important;


height: 1px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
width: 1px !important;
white-space: nowrap !important; }

.select2-container--default .select2-selection--single {
background-color: #fff;
border: 1px solid #aaa;
border-radius: 4px; }
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 28px; }
.select2-container--default .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold; }
.select2-container--default .select2-selection--single .select2-selection__placeholder {
color: #999; }
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 26px;
position: absolute;
top: 1px;
right: 1px;
width: 20px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0; }

.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {


float: left; }

.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {


left: 1px;
right: auto; }

.select2-container--default.select2-container--disabled .select2-selection--single {
background-color: #eee;
cursor: default; }
.select2-container--default.select2-container--disabled .select2-selection--single .select2-
selection__clear {
display: none; }

.select2-container--default.select2-container--open .select2-selection--single .select2-


selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }

.select2-container--default .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
cursor: text; }
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
box-sizing: border-box;
list-style: none;
margin: 0;
padding: 0 5px;
width: 100%; }
.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
list-style: none; }
.select2-container--default .select2-selection--multiple .select2-selection__clear {
cursor: pointer;
float: right;

E-Commerce Website 80
SEA College Of Science, Commerce and Art’s

font-weight: bold;
margin-top: 5px;
margin-right: 10px;
padding: 1px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
border-radius: 4px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
color: #999;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px; }
.select2-container--default .select2-selection--multiple .select2-
selection__choice__remove:hover {
color: #333; }

.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,


.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
float: right; }

.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {


margin-left: 5px;
margin-right: auto; }

.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-


selection__choice__remove {
margin-left: 2px;
margin-right: auto; }

.select2-container--default.select2-container--focus .select2-selection--multiple {
border: solid black 1px;
outline: 0; }

.select2-container--default.select2-container--disabled .select2-selection--multiple {
background-color: #eee;
cursor: default; }

.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
display: none; }

.select2-container--default.select2-container--open.select2-container--above .select2-selection-
-single, .select2-container--default.select2-container--open.select2-container--above .select2-
selection--multiple {
border-top-left-radius: 0;
border-top-right-radius: 0; }

.select2-container--default.select2-container--open.select2-container--below .select2-selection-
-single, .select2-container--default.select2-container--open.select2-container--below .select2-
selection--multiple {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }

.select2-container--default .select2-search--dropdown .select2-search__field {


border: 1px solid #aaa; }

.select2-container--default .select2-search--inline .select2-search__field {


background: transparent;
border: none;
outline: 0;
box-shadow: none;
-webkit-appearance: textfield; }

.select2-container--default .select2-results > .select2-results__options {


max-height: 200px;
overflow-y: auto; }

.select2-container--default .select2-results__option[role=group] {

E-Commerce Website 81
SEA College Of Science, Commerce and Art’s

padding: 0; }

.select2-container--default .select2-results__option[aria-disabled=true] {
color: #999; }

.select2-container--default .select2-results__option[aria-selected=true] {
background-color: #ddd; }

.select2-container--default .select2-results__option .select2-results__option {


padding-left: 1em; }
.select2-container--default .select2-results__option .select2-results__option .select2-
results__group {
padding-left: 0; }
.select2-container--default .select2-results__option .select2-results__option .select2-
results__option {
margin-left: -1em;
padding-left: 2em; }
.select2-container--default .select2-results__option .select2-results__option .select2-
results__option .select2-results__option {
margin-left: -2em;
padding-left: 3em; }
.select2-container--default .select2-results__option .select2-results__option .select2-
results__option .select2-results__option .select2-results__option {
margin-left: -3em;
padding-left: 4em; }
.select2-container--default .select2-results__option .select2-results__option .select2-
results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -4em;
padding-left: 5em; }
.select2-container--default .select2-results__option .select2-results__option
.select2-results__option .select2-results__option .select2-results__option .select2-
results__option .select2-results__option {
margin-left: -5em;
padding-left: 6em; }

.select2-container--default .select2-results__option--highlighted[aria-selected] {
background-color: #5897fb;
color: white; }

.select2-container--default .select2-results__group {
cursor: default;
display: block;
padding: 6px; }

.select2-container--classic .select2-selection--single {
background-color: #f7f7f7;
border: 1px solid #aaa;
border-radius: 4px;
outline: 0;
background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF',
endColorstr='#FFEEEEEE', GradientType=0); }
.select2-container--classic .select2-selection--single:focus {
border: 1px solid #5897fb; }
.select2-container--classic .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 28px; }
.select2-container--classic .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-right: 10px; }
.select2-container--classic .select2-selection--single .select2-selection__placeholder {
color: #999; }
.select2-container--classic .select2-selection--single .select2-selection__arrow {
background-color: #ddd;
border: none;
border-left: 1px solid #aaa;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
height: 26px;

E-Commerce Website 82
SEA College Of Science, Commerce and Art’s

position: absolute;
top: 1px;
right: 1px;
width: 20px;
background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE',
endColorstr='#FFCCCCCC', GradientType=0); }
.select2-container--classic .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0; }

.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {


float: left; }

.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {


border: none;
border-right: 1px solid #aaa;
border-radius: 0;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
left: 1px;
right: auto; }

.select2-container--classic.select2-container--open .select2-selection--single {
border: 1px solid #5897fb; }
.select2-container--classic.select2-container--open .select2-selection--single .select2-
selection__arrow {
background: transparent;
border: none; }
.select2-container--classic.select2-container--open .select2-selection--single .select2-
selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }

.select2-container--classic.select2-container--open.select2-container--above .select2-selection-
-single {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0;
background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF',
endColorstr='#FFEEEEEE', GradientType=0); }

.select2-container--classic.select2-container--open.select2-container--below .select2-selection-
-single {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE',
endColorstr='#FFFFFFFF', GradientType=0); }

.select2-container--classic .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
cursor: text;

E-Commerce Website 83
SEA College Of Science, Commerce and Art’s

outline: 0; }
.select2-container--classic .select2-selection--multiple:focus {
border: 1px solid #5897fb; }
.select2-container--classic .select2-selection--multiple .select2-selection__rendered {
list-style: none;
margin: 0;
padding: 0 5px; }
.select2-container--classic .select2-selection--multiple .select2-selection__clear {
display: none; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
border-radius: 4px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
color: #888;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px; }
.select2-container--classic .select2-selection--multiple .select2-
selection__choice__remove:hover {
color: #555; }

.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {


float: right;
margin-left: 5px;
margin-right: auto; }

.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-


selection__choice__remove {
margin-left: 2px;
margin-right: auto; }

.select2-container--classic.select2-container--open .select2-selection--multiple {
border: 1px solid #5897fb; }

.select2-container--classic.select2-container--open.select2-container--above .select2-selection-
-multiple {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0; }

.select2-container--classic.select2-container--open.select2-container--below .select2-selection-
-multiple {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }

.select2-container--classic .select2-search--dropdown .select2-search__field {


border: 1px solid #aaa;
outline: 0; }

.select2-container--classic .select2-search--inline .select2-search__field {


outline: 0;
box-shadow: none; }

.select2-container--classic .select2-dropdown {
background-color: white;
border: 1px solid transparent; }

.select2-container--classic .select2-dropdown--above {
border-bottom: none; }

.select2-container--classic .select2-dropdown--below {
border-top: none; }

.select2-container--classic .select2-results > .select2-results__options {


max-height: 200px;
overflow-y: auto; }

E-Commerce Website 84
SEA College Of Science, Commerce and Art’s

.select2-container--classic .select2-results__option[role=group] {
padding: 0; }

.select2-container--classic .select2-results__option[aria-disabled=true] {
color: grey; }

.select2-container--classic .select2-results__option--highlighted[aria-selected] {
background-color: #3875d7;
color: white; }

.select2-container--classic .select2-results__group {
cursor: default;
display: block;
padding: 6px; }

select.admin-autocomplete {
width: 20em;
}

.select2-container--admin-autocomplete.select2-container {
min-height: 30px;
}

.select2-container--admin-autocomplete .select2-selection--single,
.select2-container--admin-autocomplete .select2-selection--multiple {
min-height: 30px;
padding: 0;
}

.select2-container--admin-autocomplete.select2-container--focus .select2-selection,
.select2-container--admin-autocomplete.select2-container--open .select2-selection {
border-color: var(--body-quiet-color);
min-height: 30px;
}

.select2-container--admin-autocomplete.select2-container--focus .select2-selection.select2-
selection--single,
.select2-container--admin-autocomplete.select2-container--open .select2-selection.select2-
selection--single {
padding: 0;
}

.select2-container--admin-autocomplete.select2-container--focus .select2-selection.select2-
selection--multiple,
.select2-container--admin-autocomplete.select2-container--open .select2-selection.select2-
selection--multiple {
padding: 0;
}

.select2-container--admin-autocomplete .select2-selection--single {
background-color: var(--body-bg);
border: 1px solid var(--border-color);
border-radius: 4px;
}

.select2-container--admin-autocomplete .select2-selection--single .select2-selection__rendered {


color: var(--body-fg);
line-height: 30px;
}

.select2-container--admin-autocomplete .select2-selection--single .select2-selection__clear {


cursor: pointer;
float: right;
font-weight: bold;
}

.select2-container--admin-autocomplete .select2-selection--single .select2-


selection__placeholder {
color: var(--body-quiet-color);
}

.select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow {


height: 26px;

E-Commerce Website 85
SEA College Of Science, Commerce and Art’s

position: absolute;
top: 1px;
right: 1px;
width: 20px;
}

.select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow b {


border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0;
}

.select2-container--admin-autocomplete[dir="rtl"] .select2-selection--single .select2-


selection__clear {
float: left;
}

.select2-container--admin-autocomplete[dir="rtl"] .select2-selection--single .select2-


selection__arrow {
left: 1px;
right: auto;
}

.select2-container--admin-autocomplete.select2-container--disabled .select2-selection--single {
background-color: var(--darkened-bg);
cursor: default;
}

.select2-container--admin-autocomplete.select2-container--disabled .select2-selection--single
.select2-selection__clear {
display: none;
}

.select2-container--admin-autocomplete.select2-container--open .select2-selection--single
.select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px;
}

.select2-container--admin-autocomplete .select2-selection--multiple {
background-color: var(--body-bg);
border: 1px solid var(--border-color);
border-radius: 4px;
cursor: text;
}

.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__rendered


{
box-sizing: border-box;
list-style: none;
margin: 0;
padding: 0 10px 5px 5px;
width: 100%;
display: flex;
flex-wrap: wrap;
}

.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__rendered


li {
list-style: none;
}

.select2-container--admin-autocomplete .select2-selection--multiple .select2-


selection__placeholder {
color: var(--body-quiet-color);
margin-top: 5px;
float: left;
}

E-Commerce Website 86
SEA College Of Science, Commerce and Art’s

.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__clear {


cursor: pointer;
float: right;
font-weight: bold;
margin: 5px;
position: absolute;
right: 0;
}

.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__choice {


background-color: var(--darkened-bg);
border: 1px solid var(--border-color);
border-radius: 4px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px;
}

.select2-container--admin-autocomplete .select2-selection--multiple .select2-


selection__choice__remove {
color: var(--body-quiet-color);
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px;
}

.select2-container--admin-autocomplete .select2-selection--multiple .select2-


selection__choice__remove:hover {
color: var(--body-fg);
}

.select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-


selection__choice, .select2-container--admin-autocomplete[dir="rtl"] .select2-selection--
multiple .select2-selection__placeholder, .select2-container--admin-autocomplete[dir="rtl"]
.select2-selection--multiple .select2-search--inline {
float: right;
}

.select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-


selection__choice {
margin-left: 5px;
margin-right: auto;
}

.select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-


selection__choice__remove {
margin-left: 2px;
margin-right: auto;
}

.select2-container--admin-autocomplete.select2-container--focus .select2-selection--multiple {
border: solid var(--body-quiet-color) 1px;
outline: 0;
}

.select2-container--admin-autocomplete.select2-container--disabled .select2-selection--multiple
{
background-color: var(--darkened-bg);
cursor: default;
}

.select2-container--admin-autocomplete.select2-container--disabled .select2-
selection__choice__remove {
display: none;
}

.select2-container--admin-autocomplete.select2-container--open.select2-container--above
.select2-selection--single, .select2-container--admin-autocomplete.select2-container--
open.select2-container--above .select2-selection--multiple {
border-top-left-radius: 0;

E-Commerce Website 87
SEA College Of Science, Commerce and Art’s

border-top-right-radius: 0;
}

.select2-container--admin-autocomplete.select2-container--open.select2-container--below
.select2-selection--single, .select2-container--admin-autocomplete.select2-container--
open.select2-container--below .select2-selection--multiple {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}

.select2-container--admin-autocomplete .select2-search--dropdown {
background: var(--darkened-bg);
}

.select2-container--admin-autocomplete .select2-search--dropdown .select2-search__field {


background: var(--body-bg);
color: var(--body-fg);
border: 1px solid var(--border-color);
border-radius: 4px;
}

.select2-container--admin-autocomplete .select2-search--inline .select2-search__field {


background: transparent;
color: var(--body-fg);
border: none;
outline: 0;
box-shadow: none;
-webkit-appearance: textfield;
}

.select2-container--admin-autocomplete .select2-results > .select2-results__options {


max-height: 200px;
overflow-y: auto;
color: var(--body-fg);
background: var(--body-bg);
}

.select2-container--admin-autocomplete .select2-results__option[role=group] {
padding: 0;
}

.select2-container--admin-autocomplete .select2-results__option[aria-disabled=true] {
color: var(--body-quiet-color);
}

.select2-container--admin-autocomplete .select2-results__option[aria-selected=true] {
background-color: var(--selected-bg);
color: var(--body-fg);
}

.select2-container--admin-autocomplete .select2-results__option .select2-results__option {


padding-left: 1em;
}

.select2-container--admin-autocomplete .select2-results__option .select2-results__option


.select2-results__group {
padding-left: 0;
}

.select2-container--admin-autocomplete .select2-results__option .select2-results__option


.select2-results__option {
margin-left: -1em;
padding-left: 2em;
}

.select2-container--admin-autocomplete .select2-results__option .select2-results__option


.select2-results__option .select2-results__option {
margin-left: -2em;
padding-left: 3em;
}

.select2-container--admin-autocomplete .select2-results__option .select2-results__option


.select2-results__option .select2-results__option .select2-results__option {
margin-left: -3em;

E-Commerce Website 88
SEA College Of Science, Commerce and Art’s

padding-left: 4em;
}

.select2-container--admin-autocomplete .select2-results__option .select2-results__option


.select2-results__option .select2-results__option .select2-results__option .select2-
results__option {
margin-left: -4em;
padding-left: 5em;
}

.select2-container--admin-autocomplete .select2-results__option .select2-results__option


.select2-results__option .select2-results__option .select2-results__option .select2-
results__option .select2-results__option {
margin-left: -5em;
padding-left: 6em;
}

.select2-container--admin-autocomplete .select2-results__option--highlighted[aria-selected] {
background-color: var(--primary);
color: var(--primary-fg);
}

.select2-container--admin-autocomplete .select2-results__group {
cursor: default;
display: block;
padding: 6px;
}

/*
DJANGO Admin styles
*/

@import url(fonts.css);

/* VARIABLE DEFINITIONS */
:root {
--primary: #79aec8;
--secondary: #417690;
--accent: #f5dd5d;
--primary-fg: #fff;

--body-fg: #333;
--body-bg: #fff;
--body-quiet-color: #666;
--body-loud-color: #000;

--header-color: #ffc;
--header-branding-color: var(--accent);
--header-bg: var(--secondary);
--header-link-color: var(--primary-fg);

--breadcrumbs-fg: #c4dce8;
--breadcrumbs-link-fg: var(--body-bg);
--breadcrumbs-bg: var(--primary);

--link-fg: #447e9b;
--link-hover-color: #036;
--link-selected-fg: #5b80b2;

--hairline-color: #e8e8e8;
--border-color: #ccc;

--error-fg: #ba2121;

--message-success-bg: #dfd;
--message-warning-bg: #ffc;
--message-error-bg: #ffefef;

--darkened-bg: #f8f8f8; /* A bit darker than --body-bg */


--selected-bg: #e4e4e4; /* E.g. selected table cells */
--selected-row: #ffc;

--button-fg: #fff;
--button-bg: var(--primary);

E-Commerce Website 89
SEA College Of Science, Commerce and Art’s

--button-hover-bg: #609ab6;
--default-button-bg: var(--secondary);
--default-button-hover-bg: #205067;
--close-button-bg: #888; /* Previously #bbb, contrast 1.92 */
--close-button-hover-bg: #747474;
--delete-button-bg: #ba2121;
--delete-button-hover-bg: #a41515;

--object-tools-fg: var(--button-fg);
--object-tools-bg: var(--close-button-bg);
--object-tools-hover-bg: var(--close-button-hover-bg);
}

html, body {
height: 100%;
}

body {
margin: 0;
padding: 0;
font-size: 0.875rem;
font-family: "Roboto","Lucida Grande","DejaVu Sans","Bitstream Vera
Sans",Verdana,Arial,sans-serif;
color: var(--body-fg);
background: var(--body-bg);
}

/* LINKS */

a:link, a:visited {
color: var(--link-fg);
text-decoration: none;
transition: color 0.15s, background 0.15s;
}

a:focus, a:hover {
color: var(--link-hover-color);
}

a:focus {
text-decoration: underline;
}

a img {
border: none;
}

a.section:link, a.section:visited {
color: var(--header-link-color);
text-decoration: none;
}

a.section:focus, a.section:hover {
text-decoration: underline;
}

/* GLOBAL DEFAULTS */

p, ol, ul, dl {
margin: .2em 0 .8em 0;
}

p {
padding: 0;
line-height: 140%;
}

h1,h2,h3,h4,h5 {
font-weight: bold;
}

h1 {
margin: 0 0 20px;
font-weight: 300;

E-Commerce Website 90
SEA College Of Science, Commerce and Art’s

font-size: 1.25rem;
color: var(--body-quiet-color);
}

h2 {
font-size: 1rem;
margin: 1em 0 .5em 0;
}

h2.subhead {
font-weight: normal;
margin-top: 0;
}

h3 {
font-size: 0.875rem;
margin: .8em 0 .3em 0;
color: var(--body-quiet-color);
font-weight: bold;
}

h4 {
font-size: 0.75rem;
margin: 1em 0 .8em 0;
padding-bottom: 3px;
}

h5 {
font-size: 0.625rem;
margin: 1.5em 0 .5em 0;
color: var(--body-quiet-color);
text-transform: uppercase;
letter-spacing: 1px;
}

ul > li {
list-style-type: square;
padding: 1px 0;
}

li ul {
margin-bottom: 0;
}

li, dt, dd {
font-size: 0.8125rem;
line-height: 20px;
}

dt {
font-weight: bold;
margin-top: 4px;
}

dd {
margin-left: 0;
}

form {
margin: 0;
padding: 0;
}

fieldset {
margin: 0;
min-width: 0;
padding: 0;
border: none;
border-top: 1px solid var(--hairline-color);
}

blockquote {
font-size: 0.6875rem;
color: #777;

E-Commerce Website 91
SEA College Of Science, Commerce and Art’s

margin-left: 2px;
padding-left: 10px;
border-left: 5px solid #ddd;
}

code, pre {
font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace;
color: var(--body-quiet-color);
font-size: 0.75rem;
overflow-x: auto;
}

pre.literal-block {
margin: 10px;
background: var(--darkened-bg);
padding: 6px 8px;
}

code strong {
color: #930;
}

hr {
clear: both;
color: var(--hairline-color);
background-color: var(--hairline-color);
height: 1px;
border: none;
margin: 0;
padding: 0;
line-height: 1px;
}

/* TEXT STYLES & MODIFIERS */

.small {
font-size: 0.6875rem;
}

.mini {
font-size: 0.625rem;
}

.help, p.help, form p.help, div.help, form div.help, div.help li {


font-size: 0.6875rem;
color: var(--body-quiet-color);
}

div.help ul {
margin-bottom: 0;
}

.help-tooltip {
cursor: help;
}

p img, h1 img, h2 img, h3 img, h4 img, td img {


vertical-align: middle;
}

.quiet, a.quiet:link, a.quiet:visited {


color: var(--body-quiet-color);
font-weight: normal;
}

.clear {
clear: both;
}

.nowrap {
white-space: nowrap;
}

.hidden {

E-Commerce Website 92
SEA College Of Science, Commerce and Art’s

display: none !important;


}

/* TABLES */

table {
border-collapse: collapse;
border-color: var(--border-color);
}

td, th {
font-size: 0.8125rem;
line-height: 16px;
border-bottom: 1px solid var(--hairline-color);
vertical-align: top;
padding: 8px;
}

th {
font-weight: 600;
text-align: left;
}

thead th,
tfoot td {
color: var(--body-quiet-color);
padding: 5px 10px;
font-size: 0.6875rem;
background: var(--body-bg);
border: none;
border-top: 1px solid var(--hairline-color);
border-bottom: 1px solid var(--hairline-color);
}

tfoot td {
border-bottom: none;
border-top: 1px solid var(--hairline-color);
}

thead th.required {
color: var(--body-loud-color);
}

tr.alt {
background: var(--darkened-bg);
}

tr:nth-child(odd), .row-form-errors {
background: var(--body-bg);
}

tr:nth-child(even),
tr:nth-child(even) .errorlist,
tr:nth-child(odd) + .row-form-errors,
tr:nth-child(odd) + .row-form-errors .errorlist {
background: var(--darkened-bg);
}

/* SORTABLE TABLES */

thead th {
padding: 5px 10px;
line-height: normal;
text-transform: uppercase;
background: var(--darkened-bg);
}

thead th a:link, thead th a:visited {


color: var(--body-quiet-color);
}

thead th.sorted {
background: var(--selected-bg);
}

E-Commerce Website 93
SEA College Of Science, Commerce and Art’s

thead th.sorted .text {


padding-right: 42px;
}

table thead th .text span {


padding: 8px 10px;
display: block;
}

table thead th .text a {


display: block;
cursor: pointer;
padding: 8px 10px;
}

table thead th .text a:focus, table thead th .text a:hover {


background: var(--selected-bg);
}

thead th.sorted a.sortremove {


visibility: hidden;
}

table thead th.sorted:hover a.sortremove {


visibility: visible;
}

table thead th.sorted .sortoptions {


display: block;
padding: 9px 5px 0 5px;
float: right;
text-align: right;
}

table thead th.sorted .sortpriority {


font-size: .8em;
min-width: 12px;
text-align: center;
vertical-align: 3px;
margin-left: 2px;
margin-right: 2px;
}

table thead th.sorted .sortoptions a {


position: relative;
width: 14px;
height: 14px;
display: inline-block;
background: url(../img/sorting-icons.svg) 0 0 no-repeat;
background-size: 14px auto;
}

table thead th.sorted .sortoptions a.sortremove {


background-position: 0 0;
}

table thead th.sorted .sortoptions a.sortremove:after {


content: '\\';
position: absolute;
top: -6px;
left: 3px;
font-weight: 200;
font-size: 1.125rem;
color: var(--body-quiet-color);
}

table thead th.sorted .sortoptions a.sortremove:focus:after,


table thead th.sorted .sortoptions a.sortremove:hover:after {
color: var(--link-fg);
}

table thead th.sorted .sortoptions a.sortremove:focus,


table thead th.sorted .sortoptions a.sortremove:hover {
background-position: 0 -14px;
}

E-Commerce Website 94
SEA College Of Science, Commerce and Art’s

table thead th.sorted .sortoptions a.ascending {


background-position: 0 -28px;
}

table thead th.sorted .sortoptions a.ascending:focus,


table thead th.sorted .sortoptions a.ascending:hover {
background-position: 0 -42px;
}

table thead th.sorted .sortoptions a.descending {


top: 1px;
background-position: 0 -56px;
}

table thead th.sorted .sortoptions a.descending:focus,


table thead th.sorted .sortoptions a.descending:hover {
background-position: 0 -70px;
}

/* FORM DEFAULTS */

input, textarea, select, .form-row p, form .button {


margin: 2px 0;
padding: 2px 3px;
vertical-align: middle;
font-family: "Roboto", "Lucida Grande", Verdana, Arial, sans-serif;
font-weight: normal;
font-size: 0.8125rem;
}
.form-row div.help {
padding: 2px 3px;
}

textarea {
vertical-align: top;
}

input[type=text], input[type=password], input[type=email], input[type=url],


input[type=number], input[type=tel], textarea, select, .vTextField {
border: 1px solid var(--border-color);
border-radius: 4px;
padding: 5px 6px;
margin-top: 0;
color: var(--body-fg);
background-color: var(--body-bg);
}

input[type=text]:focus, input[type=password]:focus, input[type=email]:focus,


input[type=url]:focus, input[type=number]:focus, input[type=tel]:focus,
textarea:focus, select:focus, .vTextField:focus {
border-color: var(--body-quiet-color);
}

select {
height: 30px;
}

select[multiple] {
/* Allow HTML size attribute to override the height in the rule above. */
height: auto;
min-height: 150px;
}

/* FORM BUTTONS */

.button, input[type=submit], input[type=button], .submit-row input, a.button {


background: var(--button-bg);
padding: 10px 15px;
border: none;
border-radius: 4px;
color: var(--button-fg);
cursor: pointer;
transition: background 0.15s;
}

E-Commerce Website 95
SEA College Of Science, Commerce and Art’s

a.button {
padding: 4px 5px;
}

.button:active, input[type=submit]:active, input[type=button]:active,


.button:focus, input[type=submit]:focus, input[type=button]:focus,
.button:hover, input[type=submit]:hover, input[type=button]:hover {
background: var(--button-hover-bg);
}

.button[disabled], input[type=submit][disabled], input[type=button][disabled] {


opacity: 0.4;
}

.button.default, input[type=submit].default, .submit-row input.default {


float: right;
border: none;
font-weight: 400;
background: var(--default-button-bg);
}

.button.default:active, input[type=submit].default:active,
.button.default:focus, input[type=submit].default:focus,
.button.default:hover, input[type=submit].default:hover {
background: var(--default-button-hover-bg);
}

.button[disabled].default,
input[type=submit][disabled].default,
input[type=button][disabled].default {
opacity: 0.4;
}

/* MODULES */

.module {
border: none;
margin-bottom: 30px;
background: var(--body-bg);
}

.module p, .module ul, .module h3, .module h4, .module dl, .module pre {
padding-left: 10px;
padding-right: 10px;
}

.module blockquote {
margin-left: 12px;
}

.module ul, .module ol {


margin-left: 1.5em;
}

.module h3 {
margin-top: .6em;
}

.module h2, .module caption, .inline-group h2 {


margin: 0;
padding: 8px;
font-weight: 400;
font-size: 0.8125rem;
text-align: left;
background: var(--primary);
color: var(--header-link-color);
}

.module caption,
.inline-group h2 {
font-size: 0.75rem;
letter-spacing: 0.5px;
text-transform: uppercase;
}

E-Commerce Website 96
SEA College Of Science, Commerce and Art’s

.module table {
border-collapse: collapse;
}

/* MESSAGES & ERRORS */

ul.messagelist {
padding: 0;
margin: 0;
}

ul.messagelist li {
display: block;
font-weight: 400;
font-size: 0.8125rem;
padding: 10px 10px 10px 65px;
margin: 0 0 10px 0;
background: var(--message-success-bg) url(../img/icon-yes.svg) 40px 12px no-repeat;
background-size: 16px auto;
color: var(--body-fg);
word-break: break-word;
}

ul.messagelist li.warning {
background: var(--message-warning-bg) url(../img/icon-alert.svg) 40px 14px no-repeat;
background-size: 14px auto;
}

ul.messagelist li.error {
background: var(--message-error-bg) url(../img/icon-no.svg) 40px 12px no-repeat;
background-size: 16px auto;
}

.errornote {
font-size: 0.875rem;
font-weight: 700;
display: block;
padding: 10px 12px;
margin: 0 0 10px 0;
color: var(--error-fg);
border: 1px solid var(--error-fg);
border-radius: 4px;
background-color: var(--body-bg);
background-position: 5px 12px;
overflow-wrap: break-word;
}

ul.errorlist {
margin: 0 0 4px;
padding: 0;
color: var(--error-fg);
background: var(--body-bg);
}

ul.errorlist li {
font-size: 0.8125rem;
display: block;
margin-bottom: 4px;
overflow-wrap: break-word;
}

ul.errorlist li:first-child {
margin-top: 0;
}

ul.errorlist li a {
color: inherit;
text-decoration: underline;
}

td ul.errorlist {
margin: 0;
padding: 0;
}

E-Commerce Website 97
SEA College Of Science, Commerce and Art’s

td ul.errorlist li {
margin: 0;
}

.form-row.errors {
margin: 0;
border: none;
border-bottom: 1px solid var(--hairline-color);
background: none;
}

.form-row.errors ul.errorlist li {
padding-left: 0;
}

.errors input, .errors select, .errors textarea,


td ul.errorlist + input, td ul.errorlist + select, td ul.errorlist + textarea {
border: 1px solid var(--error-fg);
}

.description {
font-size: 0.75rem;
padding: 5px 0 0 12px;
}

/* BREADCRUMBS */

div.breadcrumbs {
background: var(--breadcrumbs-bg);
padding: 10px 40px;
border: none;
color: var(--breadcrumbs-fg);
text-align: left;
}

div.breadcrumbs a {
color: var(--breadcrumbs-link-fg);
}

div.breadcrumbs a:focus, div.breadcrumbs a:hover {


color: var(--breadcrumbs-fg);
}

/* ACTION ICONS *
.viewlink, .inlineviewlink {
padding-left: 16px;
background: url(../img/icon-viewlink.svg) 0 1px no-repeat;
}

.addlink {
padding-left: 16px;
background: url(../img/icon-addlink.svg) 0 1px no-repeat;
}

.changelink, .inlinechangelink {
padding-left: 16px;
background: url(../img/icon-changelink.svg) 0 1px no-repeat;
}

.deletelink {
padding-left: 16px;
background: url(../img/icon-deletelink.svg) 0 1px no-repeat;
}

a.deletelink:link, a.deletelink:visited {
color: #CC3434; /* XXX Probably unused? */
}

a.deletelink:focus, a.deletelink:hover {
color: #993333; /* XXX Probably unused? */
text-decoration: none;
}

E-Commerce Website 98
SEA College Of Science, Commerce and Art’s

/* OBJECT TOOLS */

.object-tools {
font-size: 0.625rem;
font-weight: bold;
padding-left: 0;
float: right;
position: relative;
margin-top: -48px;
}

.object-tools li {
display: block;
float: left;
margin-left: 5px;
height: 16px;
}

.object-tools a {
border-radius: 15px;
}

.object-tools a:link, .object-tools a:visited {


display: block;
float: left;
padding: 3px 12px;
background: var(--object-tools-bg);
color: var(--object-tools-fg);
font-weight: 400;
font-size: 0.6875rem;
text-transform: uppercase;
letter-spacing: 0.5px;
}

.object-tools a:focus, .object-tools a:hover {


background-color: var(--object-tools-hover-bg);
}

.object-tools a:focus{
text-decoration: none;
}

.object-tools a.viewsitelink, .object-tools a.addlink {


background-repeat: no-repeat;
background-position: right 7px center;
padding-right: 26px;
}

.object-tools a.viewsitelink {
background-image: url(../img/tooltag-arrowright.svg);
}

.object-tools a.addlink {
background-image: url(../img/tooltag-add.svg);
}

/* OBJECT HISTORY */

#change-history table {
width: 100%;
}

#change-history table tbody th {


width: 16em;
}

#change-history .paginator {
color: var(--body-quiet-color);
border-bottom: 1px solid var(--hairline-color);
background: var(--body-bg);
overflow: hidden;
}

/* PAGE STRUCTURE */

E-Commerce Website 99
SEA College Of Science, Commerce and Art’s

#container {
position: relative;
width: 100%;
min-width: 980px;
padding: 0;
display: flex;
flex-direction: column;
height: 100%;
}

#container > div {


flex-shrink: 0;
}

#container > .main {


display: flex;
flex: 1 0 auto;
}

.main > .content {


flex: 1 0;
max-width: 100%;
}

#content {
padding: 20px 40px;
}

.dashboard #content {
width: 600px;
}

#content-main {
float: left;
width: 100%;
}

#content-related {
float: right;
width: 260px;
position: relative;
margin-right: -300px;
}

#footer {
clear: both;
padding: 10px;
}

/* COLUMN TYPES */

.colMS {
margin-right: 300px;
}

.colSM {
margin-left: 300px;
}

.colSM #content-related {
float: left;
margin-right: 0;
margin-left: -300px;
}

.colSM #content-main {
float: right;
}

.popup .colM {
width: auto;
}

/* HEADER */

E-Commerce Website 100


SEA College Of Science, Commerce and Art’s

#header {
width: auto;
height: auto;
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 40px;
background: var(--header-bg);
color: var(--header-color);
overflow: hidden;
}

#header a:link, #header a:visited, #logout-form button {


color: var(--header-link-color);
}

#header a:focus , #header a:hover {


text-decoration: underline;
}

#branding {
float: left;
}

#branding h1 {
padding: 0;
margin: 0 20px 0 0;
font-weight: 300;
font-size: 1.5rem;
color: var(--header-branding-color);
}

#branding h1 a:link, #branding h1 a:visited {


color: var(--accent);
}

#branding h2 {
padding: 0 10px;
font-size: 0.875rem;
margin: -8px 0 8px 0;
font-weight: normal;
color: var(--header-color);
}

#branding a:hover {
text-decoration: none;
}

#logout-form {
display: inline;
}

#logout-form button {
background: none;
border: 0;
cursor: pointer;
font-family: "Roboto","Lucida Grande","DejaVu Sans","Bitstream Vera
Sans",Verdana,Arial,sans-serif;
}

#user-tools {
float: right;
margin: 0 0 0 20px;
text-align: right;
}

#user-tools, #logout-form button{


padding: 0;
font-weight: 300;
font-size: 0.6875rem;
letter-spacing: 0.5px;
text-transform: uppercase;
}

E-Commerce Website 101


SEA College Of Science, Commerce and Art’s

#user-tools a, #logout-form button {


border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

#user-tools a:focus, #user-tools a:hover,


#logout-form button:active, #logout-form button:hover {
text-decoration: none;
border-bottom: 0;
}

#logout-form button:active, #logout-form button:hover {


margin-bottom: 1px;
}

/* SIDEBAR */

#content-related {
background: var(--darkened-bg);
}

#content-related .module {
background: none;
}

#content-related h3 {
color: var(--body-quiet-color);
padding: 0 16px;
margin: 0 0 16px;
}

#content-related h4 {
font-size: 0.8125rem;
}

#content-related p {
padding-left: 16px;
padding-right: 16px;
}

#content-related .actionlist {
padding: 0;
margin: 16px;
}

#content-related .actionlist li {
line-height: 1.2;
margin-bottom: 10px;
padding-left: 18px;
}

#content-related .module h2 {
background: none;
padding: 16px;
margin-bottom: 16px;
border-bottom: 1px solid var(--hairline-color);
font-size: 1.125rem;
color: var(--body-fg);
}

.delete-confirmation form input[type="submit"] {


background: var(--delete-button-bg);
border-radius: 4px;
padding: 10px 15px;
color: var(--button-fg);
}

.delete-confirmation form input[type="submit"]:active,


.delete-confirmation form input[type="submit"]:focus,
.delete-confirmation form input[type="submit"]:hover {
background: var(--delete-button-hover-bg);
}

.delete-confirmation form .cancel-link {


display: inline-block;

E-Commerce Website 102


SEA College Of Science, Commerce and Art’s

vertical-align: middle;
height: 15px;
line-height: 15px;
border-radius: 4px;
padding: 10px 15px;
color: var(--button-fg);
background: var(--close-button-bg);
margin: 0 0 0 10px;
}

.delete-confirmation form .cancel-link:active,


.delete-confirmation form .cancel-link:focus,
.delete-confirmation form .cancel-link:hover {
background: var(--close-button-hover-bg);
}

/* POPUP */
.popup #content {
padding: 20px;
}

.popup #container {
min-width: 0;
}

.popup #header {
padding: 10px 20px;
}

/* PAGINATOR */

.paginator {
font-size: 0.8125rem;
padding-top: 10px;
padding-bottom: 10px;
line-height: 22px;
margin: 0;
border-top: 1px solid var(--hairline-color);
width: 100%;
}

.paginator a:link, .paginator a:visited {


padding: 2px 6px;
background: var(--button-bg);
text-decoration: none;
color: var(--button-fg);
}

.paginator a.showall {
border: none;
background: none;
color: var(--link-fg);
}

.paginator a.showall:focus, .paginator a.showall:hover {


background: none;
color: var(--link-hover-color);
}

.paginator .end {
margin-right: 6px;
}

.paginator .this-page {
padding: 2px 6px;
font-weight: bold;
font-size: 0.8125rem;
vertical-align: top;
}

.paginator a:focus, .paginator a:hover {


color: white;
background: var(--link-hover-color);
}

E-Commerce Website 103


SEA College Of Science, Commerce and Art’s

/* CHANGELISTS */

#changelist {
display: flex;
align-items: flex-start;
justify-content: space-between;
}

#changelist .changelist-form-container {
flex: 1 1 auto;
min-width: 0;
}

#changelist table {
width: 100%;
}

.change-list .hiddenfields { display:none; }

.change-list .filtered table {


border-right: none;
}

.change-list .filtered {
min-height: 400px;
}

.change-list .filtered .results, .change-list .filtered .paginator,


.filtered #toolbar, .filtered div.xfull {
width: auto;
}

.change-list .filtered table tbody th {


padding-right: 1em;
}

#changelist-form .results {
overflow-x: auto;
width: 100%;
}

#changelist .toplinks {
border-bottom: 1px solid var(--hairline-color);
}

#changelist .paginator {
color: var(--body-quiet-color);
border-bottom: 1px solid var(--hairline-color);
background: var(--body-bg);
overflow: hidden;
}

/* CHANGELIST TABLES */

#changelist table thead th {


padding: 0;
white-space: nowrap;
vertical-align: middle;
}

#changelist table thead th.action-checkbox-column {


width: 1.5em;
text-align: center;
}

#changelist table tbody td.action-checkbox {


text-align: center;
}

#changelist table tfoot {


color: var(--body-quiet-color);
}

/* TOOLBAR */

E-Commerce Website 104


SEA College Of Science, Commerce and Art’s

#toolbar {
padding: 8px 10px;
margin-bottom: 15px;
border-top: 1px solid var(--hairline-color);
border-bottom: 1px solid var(--hairline-color);
background: var(--darkened-bg);
color: var(--body-quiet-color);
}

#toolbar form input {


border-radius: 4px;
font-size: 0.875rem;
padding: 5px;
color: var(--body-fg);
}

#toolbar #searchbar {
height: 19px;
border: 1px solid var(--border-color);
padding: 2px 5px;
margin: 0;
vertical-align: top;
font-size: 0.8125rem;
max-width: 100%;
}

#toolbar #searchbar:focus {
border-color: var(--body-quiet-color);
}

#toolbar form input[type="submit"] {


border: 1px solid var(--border-color);
font-size: 0.8125rem;
padding: 4px 8px;
margin: 0;
vertical-align: middle;
background: var(--body-bg);
box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset;
cursor: pointer;
color: var(--body-fg);
}

#toolbar form input[type="submit"]:focus,


#toolbar form input[type="submit"]:hover {
border-color: var(--body-quiet-color);
}

#changelist-search img {
vertical-align: middle;
margin-right: 4px;
}

#changelist-search .help {
word-break: break-word;
}

/* FILTER COLUMN */

#changelist-filter {
flex: 0 0 240px;
order: 1;
background: var(--darkened-bg);
border-left: none;
margin: 0 0 0 30px;
}

#changelist-filter h2 {
font-size: 0.875rem;
text-transform: uppercase;
letter-spacing: 0.5px;
padding: 5px 15px;
margin-bottom: 12px;
border-bottom: none;
}

E-Commerce Website 105


SEA College Of Science, Commerce and Art’s

#changelist-filter h3,
#changelist-filter details summary {
font-weight: 400;
padding: 0 15px;
margin-bottom: 10px;
}

#changelist-filter details summary > * {


display: inline;
}

#changelist-filter details > summary {


list-style-type: none;
}

#changelist-filter details > summary::-webkit-details-marker {


display: none;
}

#changelist-filter details > summary::before {


content: '→';
font-weight: bold;
color: var(--link-hover-color);
}

#changelist-filter details[open] > summary::before {


content: '↓';
}

#changelist-filter ul {
margin: 5px 0;
padding: 0 15px 15px;
border-bottom: 1px solid var(--hairline-color);
}

#changelist-filter ul:last-child {
border-bottom: none;
}

#changelist-filter li {
list-style-type: none;
margin-left: 0;
padding-left: 0;
}

#changelist-filter a {
display: block;
color: var(--body-quiet-color);
word-break: break-word;
}

#changelist-filter li.selected {
border-left: 5px solid var(--hairline-color);
padding-left: 10px;
margin-left: -15px;
}

#changelist-filter li.selected a {
color: var(--link-selected-fg);
}

#changelist-filter a:focus, #changelist-filter a:hover,


#changelist-filter li.selected a:focus,
#changelist-filter li.selected a:hover {
color: var(--link-hover-color);
}

#changelist-filter #changelist-filter-clear a {
font-size: 0.8125rem;
padding-bottom: 10px;
border-bottom: 1px solid var(--hairline-color);
}

/* DATE DRILLDOWN */

E-Commerce Website 106


SEA College Of Science, Commerce and Art’s

.change-list ul.toplinks {
display: block;
float: left;
padding: 0;
margin: 0;
width: 100%;
}

.change-list ul.toplinks li {
padding: 3px 6px;
font-weight: bold;
list-style-type: none;
display: inline-block;
}

.change-list ul.toplinks .date-back a {


color: var(--body-quiet-color);
}

.change-list ul.toplinks .date-back a:focus,


.change-list ul.toplinks .date-back a:hover {
color: var(--link-hover-color);
}

/* ACTIONS */

.filtered .actions {
border-right: none;
}

#changelist table input {


margin: 0;
vertical-align: baseline;
}

#changelist table tbody tr.selected {


background-color: var(--selected-row);
}

#changelist .actions {
padding: 10px;
background: var(--body-bg);
border-top: none;
border-bottom: none;
line-height: 24px;
color: var(--body-quiet-color);
width: 100%;
}

#changelist .actions span.all,


#changelist .actions span.action-counter,
#changelist .actions span.clear,
#changelist .actions span.question {
font-size: 0.8125rem;
margin: 0 0.5em;
}

#changelist .actions:last-child {
border-bottom: none;
}

#changelist .actions select {


vertical-align: top;
height: 24px;
color: var(--body-fg);
border: 1px solid var(--border-color);
border-radius: 4px;
font-size: 0.875rem;
padding: 0 0 0 4px;
margin: 0;
margin-left: 10px;
}

#changelist .actions select:focus {

E-Commerce Website 107


SEA College Of Science, Commerce and Art’s

border-color: var(--body-quiet-color);
}

#changelist .actions label {


display: inline-block;
vertical-align: middle;
font-size: 0.8125rem;
}

#changelist .actions .button {


font-size: 0.8125rem;
border: 1px solid var(--border-color);
border-radius: 4px;
background: var(--body-bg);
box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset;
cursor: pointer;
height: 24px;
line-height: 1;
padding: 4px 8px;
margin: 0;
color: var(--body-fg);
}

#changelist .actions .button:focus, #changelist .actions .button:hover {


border-color: var(--body-quiet-color);
}

@media (prefers-color-scheme: dark) {


:root {
--primary: #264b5d;
--primary-fg: #f7f7f7;

--body-fg: #eeeeee;
--body-bg: #121212;
--body-quiet-color: #e0e0e0;
--body-loud-color: #ffffff;

--breadcrumbs-link-fg: #e0e0e0;
--breadcrumbs-bg: var(--primary);

--link-fg: #81d4fa;
--link-hover-color: #4ac1f7;
--link-selected-fg: #6f94c6;

--hairline-color: #272727;
--border-color: #353535;

--error-fg: #e35f5f;
--message-success-bg: #006b1b;
--message-warning-bg: #583305;
--message-error-bg: #570808;

--darkened-bg: #212121;
--selected-bg: #1b1b1b;
--selected-row: #00363a;

--close-button-bg: #333333;
--close-button-hover-bg: #666666;
}
}

/* DASHBOARD */

.dashboard .module table th {


width: 100%;
}

.dashboard .module table td {


white-space: nowrap;
}

.dashboard .module table td a {


display: block;
padding-right: .6em;
}

E-Commerce Website 108


SEA College Of Science, Commerce and Art’s

/* RECENT ACTIONS MODULE */

.module ul.actionlist {
margin-left: 0;
}

ul.actionlist li {
list-style-type: none;
overflow: hidden;
text-overflow: ellipsis;
}

@font-face {
font-family: 'Roboto';
src: url('../fonts/Roboto-Bold-webfont.woff');
font-weight: 700;
font-style: normal;
}

@font-face {
font-family: 'Roboto';
src: url('../fonts/Roboto-Regular-webfont.woff');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Roboto';
src: url('../fonts/Roboto-Light-webfont.woff');
font-weight: 300;
font-style: normal;
}
@import url('widgets.css');

/* FORM ROWS */

.form-row {
overflow: hidden;
padding: 10px;
font-size: 0.8125rem;
border-bottom: 1px solid var(--hairline-color);
}

.form-row img, .form-row input {


vertical-align: middle;
}

.form-row label input[type="checkbox"] {


margin-top: 0;
vertical-align: 0;
}

form .form-row p {
padding-left: 0;
}

/* FORM LABELS */

label {
font-weight: normal;
color: var(--body-quiet-color);
font-size: 0.8125rem;
}

.required label, label.required {


font-weight: bold;
color: var(--body-fg);
}

/* RADIO BUTTONS */

form div.radiolist div {


padding-right: 7px;
}

E-Commerce Website 109


SEA College Of Science, Commerce and Art’s

form div.radiolist.inline div {


display: inline-block;
}

form div.radiolist label {


width: auto;
}

form div.radiolist input[type="radio"] {


margin: -2px 4px 0 0;
padding: 0;
}

form ul.inline {
margin-left: 0;
padding: 0;
}

form ul.inline li {
float: left;
padding-right: 7px;
}

/* ALIGNED FIELDSETS */

.aligned label {
display: block;
padding: 4px 10px 0 0;
float: left;
width: 160px;
word-wrap: break-word;
line-height: 1;
}

.aligned label:not(.vCheckboxLabel):after {
content: '';
display: inline-block;
vertical-align: middle;
height: 26px;
}

.aligned label + p, .aligned label + div.help, .aligned label + div.readonly {


padding: 6px 0;
margin-top: 0;
margin-bottom: 0;
margin-left: 170px;
overflow-wrap: break-word;
}

.aligned ul label {
display: inline;
float: none;
width: auto;
}

.aligned .form-row input {


margin-bottom: 0;
}

.colMS .aligned .vLargeTextField, .colMS .aligned .vXMLLargeTextField {


width: 350px;
}

form .aligned ul {
margin-left: 160px;
padding-left: 10px;
}

form .aligned div.radiolist {


display: inline-block;
margin: 0;
padding: 0;
}

E-Commerce Website 110


SEA College Of Science, Commerce and Art’s

form .aligned p.help,


form .aligned div.help {
clear: left;
margin-top: 0;
margin-left: 160px;
padding-left: 10px;
}

form .aligned label + p.help,


form .aligned label + div.help {
margin-left: 0;
padding-left: 0;
}

form .aligned p.help:last-child,


form .aligned div.help:last-child {
margin-bottom: 0;
padding-bottom: 0;
}

form .aligned input + p.help,


form .aligned textarea + p.help,
form .aligned select + p.help,
form .aligned input + div.help,
form .aligned textarea + div.help,
form .aligned select + div.help {
margin-left: 160px;
padding-left: 10px;
}

form .aligned ul li {
list-style: none;
}

form .aligned table p {


margin-left: 0;
padding-left: 0;
}

.aligned .vCheckboxLabel {
float: none;
width: auto;
display: inline-block;
vertical-align: -3px;
padding: 0 0 5px 5px;
}

.aligned .vCheckboxLabel + p.help,


.aligned .vCheckboxLabel + div.help {
margin-top: -4px;
}

.colM .aligned .vLargeTextField, .colM .aligned .vXMLLargeTextField {


width: 610px;
}

.checkbox-row p.help,
.checkbox-row div.help {
margin-left: 0;
padding-left: 0;
}

fieldset .fieldBox {
float: left;
margin-right: 20px;
}

/* WIDE FIELDSETS */

.wide label {
width: 200px;
}

form .wide p,

E-Commerce Website 111


SEA College Of Science, Commerce and Art’s

form .wide input + p.help,


form .wide input + div.help {
margin-left: 200px;
}

form .wide p.help,


form .wide div.help {
padding-left: 38px;
}

form div.help ul {
padding-left: 0;
margin-left: 0;
}

.colM fieldset.wide .vLargeTextField, .colM fieldset.wide .vXMLLargeTextField {


width: 450px;
}

/* COLLAPSED FIELDSETS */

fieldset.collapsed * {
display: none;
}

fieldset.collapsed h2, fieldset.collapsed {


display: block;
}

fieldset.collapsed {
border: 1px solid var(--hairline-color);
border-radius: 4px;
overflow: hidden;
}

fieldset.collapsed h2 {
background: var(--darkened-bg);
color: var(--body-quiet-color);
}

fieldset .collapse-toggle {
color: var(--header-link-color);
}

fieldset.collapsed .collapse-toggle {
background: transparent;
display: inline;
color: var(--link-fg);
}

/* MONOSPACE TEXTAREAS */

fieldset.monospace textarea {
font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace;
}

/* SUBMIT ROW */

.submit-row {
padding: 12px 14px 7px;
margin: 0 0 20px;
background: var(--darkened-bg);
border: 1px solid var(--hairline-color);
border-radius: 4px;
text-align: right;
overflow: hidden;
}

body.popup .submit-row {
overflow: auto;
}

.submit-row input {
height: 35px;

E-Commerce Website 112


SEA College Of Science, Commerce and Art’s

line-height: 15px;
margin: 0 0 5px 5px;
}

.submit-row input.default {
margin: 0 0 5px 8px;
text-transform: uppercase;
}

.submit-row p {
margin: 0.3em;
}

.submit-row p.deletelink-box {
float: left;
margin: 0;
}

.submit-row a.deletelink {
display: block;
background: var(--delete-button-bg);
border-radius: 4px;
padding: 10px 15px;
height: 15px;
line-height: 15px;
margin-bottom: 5px;
color: var(--button-fg);
}
.submit-row a.closelink {
display: inline-block;
background: var(--close-button-bg);
border-radius: 4px;
padding: 10px 15px;
height: 15px;
line-height: 15px;
margin: 0 0 0 5px;
color: var(--button-fg);
}
submit-row a.deletelink:focus,
.submit-row a.deletelink:hover,
.submit-row a.deletelink:active {
background: var(--delete-button-hover-bg);
}

.submit-row a.closelink:focus,
.submit-row a.closelink:hover,
.submit-row a.closelink:active {
background: var(--close-button-hover-bg);
}

/* CUSTOM FORM FIELDS */

.vSelectMultipleField {
vertical-align: top;
}

.vCheckboxField {
border: none;
}

.vDateField, .vTimeField {
margin-right: 2px;
margin-bottom: 4px;
}

.vDateField {
min-width: 6.85em;
}

.vTimeField {
min-width: 4.7em;
}

.vURLField {

E-Commerce Website 113


SEA College Of Science, Commerce and Art’s

width: 30em;
}

.vLargeTextField, .vXMLLargeTextField {
width: 48em;
}

.flatpages-flatpage #id_content {
height: 40.2em;
}

.module table .vPositiveSmallIntegerField {


width: 2.2em;
}

.vIntegerField {
width: 5em;
}

.vBigIntegerField {
width: 10em;
}

.vForeignKeyRawIdAdminField {
width: 5em;
}

.vTextField, .vUUIDField {
width: 20em;
}

/* INLINES */

.inline-group {
padding: 0;
margin: 0 0 30px;
}

.inline-group thead th {
padding: 8px 10px;
}

.inline-group .aligned label {


width: 160px;
}

.inline-related {
position: relative;
}

.inline-related h3 {
margin: 0;
color: var(--body-quiet-color);
padding: 5px;
font-size: 0.8125rem;
background: var(--darkened-bg);
border-top: 1px solid var(--hairline-color);
border-bottom: 1px solid var(--hairline-color);
}

.inline-related h3 span.delete {
float: right;
}

.inline-related h3 span.delete label {


margin-left: 2px;
font-size: 0.6875rem;
}

.inline-related fieldset {
margin: 0;
background: var(--body-bg);
border: none;
width: 100%;
}

E-Commerce Website 114


SEA College Of Science, Commerce and Art’s

.inline-related fieldset.module h3 {
margin: 0;
padding: 2px 5px 3px 5px;
font-size: 0.6875rem;
text-align: left;
font-weight: bold;
background: #bcd;
color: var(--body-bg);
}

.inline-group .tabular fieldset.module {


border: none;
}

.inline-related.tabular fieldset.module table {


width: 100%;
overflow-x: scroll;
}

.last-related fieldset {
border: none;
}

.inline-group .tabular tr.has_original td {


padding-top: 2em;
}

.inline-group .tabular tr td.original {


padding: 2px 0 0 0;
width: 0;
_position: relative;
}

.inline-group .tabular th.original {


width: 0px;
padding: 0;
}

.inline-group .tabular td.original p {


position: absolute;
left: 0;
height: 1.1em;
padding: 2px 9px;
overflow: hidden;
font-size: 0.5625rem;
font-weight: bold;
color: var(--body-quiet-color);
_width: 700px;
}

.inline-group ul.tools {
padding: 0;
margin: 0;
list-style: none;
}

.inline-group ul.tools li {
display: inline;
padding: 0 5px;
}

.inline-group div.add-row,
.inline-group .tabular tr.add-row td {
color: var(--body-quiet-color);
background: var(--darkened-bg);
padding: 8px 10px;
border-bottom: 1px solid var(--hairline-color);
}

.inline-group .tabular tr.add-row td {


padding: 8px 10px;
border-bottom: 1px solid var(--hairline-color);
}

E-Commerce Website 115


SEA College Of Science, Commerce and Art’s

.inline-group ul.tools a.add,


.inline-group div.add-row a,
.inline-group .tabular tr.add-row td a {
background: url(../img/icon-addlink.svg) 0 1px no-repeat;
padding-left: 16px;
font-size: 0.75rem;
}

.empty-form {
display: none;
}

/* RELATED FIELD ADD ONE / LOOKUP */

.related-lookup {
margin-left: 5px;
display: inline-block;
vertical-align: middle;
background-repeat: no-repeat;
background-size: 14px;
}

.related-lookup {
width: 16px;
height: 16px;
background-image: url(../img/search.svg);
}

form .related-widget-wrapper ul {
display: inline-block;
margin-left: 0;
padding-left: 0;
}

.clearable-file-input input {
margin-top: 0;
}

/* SELECTOR (FILTER INTERFACE) */

.selector {
width: 800px;
float: left;
display: flex;
}

.selector select {
width: 380px;
height: 17.2em;
flex: 1 0 auto;
}

.selector-available, .selector-chosen {
width: 380px;
text-align: center;
margin-bottom: 5px;
display: flex;
flex-direction: column;
}

.selector-chosen select {
border-top: none;
}

.selector-available h2, .selector-chosen h2 {


border: 1px solid var(--border-color);
border-radius: 4px 4px 0 0;
}

.selector-chosen h2 {
background: var(--primary);
color: var(--header-link-color);
}

E-Commerce Website 116


SEA College Of Science, Commerce and Art’s

.selector .selector-available h2 {
background: var(--darkened-bg);
color: var(--body-quiet-color);
}

.selector .selector-filter {
border: 1px solid var(--border-color);
border-width: 0 1px;
padding: 8px;
color: var(--body-quiet-color);
font-size: 0.625rem;
margin: 0;
text-align: left;
}

.selector .selector-filter label,


.inline-group .aligned .selector .selector-filter label {
float: left;
margin: 7px 0 0;
width: 18px;
height: 18px;
padding: 0;
overflow: hidden;
line-height: 1;
}

.selector .selector-available input {


width: 320px;
margin-left: 8px;
}

.selector ul.selector-chooser {
align-self: center;
width: 22px;
background-color: var(--selected-bg);
border-radius: 10px;
margin: 0 5px;
padding: 0;
transform: translateY(-17px);
}

.selector-chooser li {
margin: 0;
padding: 3px;
list-style-type: none;
}

.selector select {
padding: 0 10px;
margin: 0 0 10px;
border-radius: 0 0 4px 4px;
}

.selector-add, .selector-remove {
width: 16px;
height: 16px;
display: block;
text-indent: -3000px;
overflow: hidden;
cursor: default;
opacity: 0.55;
}

.active.selector-add, .active.selector-remove {
opacity: 1;
}

.active.selector-add:hover, .active.selector-remove:hover {
cursor: pointer;
}

.selector-add {
background: url(../img/selector-icons.svg) 0 -96px no-repeat;
}

E-Commerce Website 117


SEA College Of Science, Commerce and Art’s

.active.selector-add:focus, .active.selector-add:hover {
background-position: 0 -112px;
}

.selector-remove {
background: url(../img/selector-icons.svg) 0 -64px no-repeat;
}

.active.selector-remove:focus, .active.selector-remove:hover {
background-position: 0 -80px;
}

a.selector-chooseall, a.selector-clearall {
display: inline-block;
height: 16px;
text-align: left;
margin: 1px auto 3px;
overflow: hidden;
font-weight: bold;
line-height: 16px;
color: var(--body-quiet-color);
text-decoration: none;
opacity: 0.55;
}

a.active.selector-chooseall:focus, a.active.selector-clearall:focus,
a.active.selector-chooseall:hover, a.active.selector-clearall:hover {
color: var(--link-fg);
}

a.active.selector-chooseall, a.active.selector-clearall {
opacity: 1;
}

a.active.selector-chooseall:hover, a.active.selector-clearall:hover {
cursor: pointer;
}

a.selector-chooseall {
padding: 0 18px 0 0;
background: url(../img/selector-icons.svg) right -160px no-repeat;
cursor: default;
}

a.active.selector-chooseall:focus, a.active.selector-chooseall:hover {
background-position: 100% -176px;
}

a.selector-clearall {
padding: 0 0 0 18px;
background: url(../img/selector-icons.svg) 0 -128px no-repeat;
cursor: default;
}

a.active.selector-clearall:focus, a.active.selector-clearall:hover {
background-position: 0 -144px;
}

/* STACKED SELECTORS */

.stacked {
float: left;
width: 490px;
display: block;
}

.stacked select {
width: 480px;
height: 10.1em;
}

.stacked .selector-available, .stacked .selector-chosen {


width: 480px;
}

E-Commerce Website 118


SEA College Of Science, Commerce and Art’s

.stacked .selector-available {
margin-bottom: 0;
}

.stacked .selector-available input {


width: 422px;
}

.stacked ul.selector-chooser {
height: 22px;
width: 50px;
margin: 0 0 10px 40%;
background-color: #eee;
border-radius: 10px;
transform: none;
}

.stacked .selector-chooser li {
float: left;
padding: 3px 3px 3px 5px;
}

.stacked .selector-chooseall, .stacked .selector-clearall {


display: none;
}

.stacked .selector-add {
background: url(../img/selector-icons.svg) 0 -32px no-repeat;
cursor: default;
}

.stacked .active.selector-add {
background-position: 0 -32px;
cursor: pointer;
}

.stacked .active.selector-add:focus, .stacked .active.selector-add:hover {


background-position: 0 -48px;
cursor: pointer;
}

.stacked .selector-remove {
background: url(../img/selector-icons.svg) 0 0 no-repeat;
cursor: default;
}

.stacked .active.selector-remove {
background-position: 0 0px;
cursor: pointer;
}

.stacked .active.selector-remove:focus, .stacked .active.selector-remove:hover {


background-position: 0 -16px;
cursor: pointer;
}

.selector .help-icon {
background: url(../img/icon-unknown.svg) 0 0 no-repeat;
display: inline-block;
vertical-align: middle;
margin: -2px 0 0 2px;
width: 13px;
height: 13px;
}

.selector .selector-chosen .help-icon {


background: url(../img/icon-unknown-alt.svg) 0 0 no-repeat;
}

.selector .search-label-icon {
background: url(../img/search.svg) 0 0 no-repeat;
display: inline-block;
height: 18px;
width: 18px;
}

E-Commerce Website 119


SEA College Of Science, Commerce and Art’s

/* DATE AND TIME */

p.datetime {
line-height: 20px;
margin: 0;
padding: 0;
color: var(--body-quiet-color);
font-weight: bold;
}

.datetime span {
white-space: nowrap;
font-weight: normal;
font-size: 0.6875rem;
color: var(--body-quiet-color);
}

.datetime input, .form-row .datetime input.vDateField, .form-row .datetime input.vTimeField {


margin-left: 5px;
margin-bottom: 4px;
}

table p.datetime {
font-size: 0.6875rem;
margin-left: 0;
padding-left: 0;
}

.datetimeshortcuts .clock-icon, .datetimeshortcuts .date-icon {


position: relative;
display: inline-block;
vertical-align: middle;
height: 16px;
width: 16px;
overflow: hidden;
}

.datetimeshortcuts .clock-icon {
background: url(../img/icon-clock.svg) 0 0 no-repeat;
}

.datetimeshortcuts a:focus .clock-icon,


.datetimeshortcuts a:hover .clock-icon {
background-position: 0 -16px;
}

.datetimeshortcuts .date-icon {
background: url(../img/icon-calendar.svg) 0 0 no-repeat;
top: -1px;
}

.datetimeshortcuts a:focus .date-icon,


.datetimeshortcuts a:hover .date-icon {
background-position: 0 -16px;
}

.timezonewarning {
font-size: 0.6875rem;
color: var(--body-quiet-color);
}

/* URL */

p.url {
line-height: 20px;
margin: 0;
padding: 0;
color: var(--body-quiet-color);
font-size: 0.6875rem;
font-weight: bold;
}

.url a {

E-Commerce Website 120


SEA College Of Science, Commerce and Art’s

font-weight: normal;
}

/* FILE UPLOADS */

p.file-upload {
line-height: 20px;
margin: 0;
padding: 0;
color: var(--body-quiet-color);
font-size: 0.6875rem;
font-weight: bold;
}

.aligned p.file-upload {
margin-left: 170px;
}

.file-upload a {
font-weight: normal;
}

.file-upload .deletelink {
margin-left: 5px;
}

span.clearable-file-input label {
color: var(--body-fg);
font-size: 0.6875rem;
display: inline;
float: none;
}

/* CALENDARS & CLOCKS */

.calendarbox, .clockbox {
margin: 5px auto;
font-size: 0.75rem;
width: 19em;
text-align: center;
background: var(--body-bg);
color: var(--body-fg);
border: 1px solid var(--hairline-color);
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
overflow: hidden;
position: relative;
}

.clockbox {
width: auto;
}

.calendar {
margin: 0;
padding: 0;
}

.calendar table {
margin: 0;
padding: 0;
border-collapse: collapse;
background: white;
width: 100%;
}

.calendar caption, .calendarbox h2 {


margin: 0;
text-align: center;
border-top: none;
font-weight: 700;
font-size: 0.75rem;
color: #333;
background: var(--accent);
}

E-Commerce Website 121


SEA College Of Science, Commerce and Art’s

.calendar th {
padding: 8px 5px;
background: var(--darkened-bg);
border-bottom: 1px solid var(--border-color);
font-weight: 400;
font-size: 0.75rem;
text-align: center;
color: var(--body-quiet-color);
}

.calendar td {
font-weight: 400;
font-size: 0.75rem;
text-align: center;
padding: 0;
border-top: 1px solid var(--hairline-color);
border-bottom: none;
}

.calendar td.selected a {
background: var(--primary);
color: var(--button-fg);
}

.calendar td.nonday {
background: var(--darkened-bg);
}

.calendar td.today a {
font-weight: 700;
}
.calendar td a, .timelist a {
display: block;
font-weight: 400;
padding: 6px;
text-decoration: none;
color: var(--body-quiet-color);
}

.calendar td a:focus, .timelist a:focus,


.calendar td a:hover, .timelist a:hover {
background: var(--primary);
color: white;
}

.calendar td a:active, .timelist a:active {


background: var(--header-bg);
color: white;
}

.calendarnav {
font-size: 0.625rem;
text-align: center;
color: #ccc;
margin: 0;
padding: 1px 3px;
}

.calendarnav a:link, #calendarnav a:visited,


#calendarnav a:focus, #calendarnav a:hover {
color: var(--body-quiet-color);
}

.calendar-shortcuts {
background: var(--body-bg);
color: var(--body-quiet-color);
font-size: 0.6875rem;
line-height: 11px;
border-top: 1px solid var(--hairline-color);
padding: 8px 0;
}

.calendarbox .calendarnav-previous, .calendarbox .calendarnav-next {

E-Commerce Website 122


SEA College Of Science, Commerce and Art’s

display: block;
position: absolute;
top: 8px;
width: 15px;
height: 15px;
text-indent: -9999px;
padding: 0;
}
.calendarnav-previous {
left: 10px;
background: url(../img/calendar-icons.svg) 0 0 no-repeat;
}

.calendarbox .calendarnav-previous:focus,
.calendarbox .calendarnav-previous:hover {
background-position: 0 -15px;
}

.calendarnav-next {
right: 10px;
background: url(../img/calendar-icons.svg) 0 -30px no-repeat;
}

.calendarbox .calendarnav-next:focus,
.calendarbox .calendarnav-next:hover {
background-position: 0 -45px;
}

.calendar-cancel {
margin: 0;
padding: 4px 0;
font-size: 0.75rem;
background: #eee;
border-top: 1px solid var(--border-color);
color: var(--body-fg);
}

.calendar-cancel:focus, .calendar-cancel:hover {
background: #ddd;
}

.calendar-cancel a {
color: black;
display: block;
}

ul.timelist, .timelist li {
list-style-type: none;
margin: 0;
padding: 0;
}

.timelist a {
padding: 2px;
}

/* EDIT INLINE */

.inline-deletelink {
float: right;
text-indent: -9999px;
background: url(../img/inline-delete.svg) 0 0 no-repeat;
width: 16px;
height: 16px;
border: 0px none;
}

.inline-deletelink:focus, .inline-deletelink:hover {
cursor: pointer;
}

/* RELATED WIDGET WRAPPER */


.related-widget-wrapper {
float: left; /* display properly in form rows with multiple fields */

E-Commerce Website 123


SEA College Of Science, Commerce and Art’s

overflow: hidden; /* clear floated contents */


}

.related-widget-wrapper-link {
opacity: 0.3;
}

.related-widget-wrapper-link:link {
opacity: .8;
}

.related-widget-wrapper-link:link:focus,
.related-widget-wrapper-link:link:hover {
opacity: 1;
}

select + .related-widget-wrapper-link,
.related-widget-wrapper-link + .related-widget-wrapper-link {
margin-left: 7px;
}

E-Commerce Website 124


SEA College Of Science, Commerce and Art’s

SCREENSHOTS

E-Commerce Website 125


SEA College Of Science, Commerce and Art’s

E-Commerce Website 126


SEA College Of Science, Commerce and Art’s

E-Commerce Website 127


SEA College Of Science, Commerce and Art’s

IMPLEMENTATION

The final and important phase in system life cycle is the installation of the new system. The term
installation has different meaning, ranging from the conversion of basic application a complete replacement
of a computer system. The procedure, however are virtually the same. Installation is the process of converting
a new system into an operational one. It involves user training and successful running of the developed
system.
In the installation phase the user and the system manuals are prepared handed over to the user to
operate the developed system. The object of each manual is the same but the target customers may be
different.
The user manual is aimed to those who would be using the system but not interested in technical
information about the insides of the system, or implementation of login within the system.

The information that they are interested are-

• Scope of the system


• Flow and links across the programs and modules
• Validation done within the program
• The actual usage of the system.

The contents of the user manual are the following:

• Usage description
• Back up procedures
• Security measures

• Inputs and output’s formats

E-Commerce Website 128


SEA College Of Science, Commerce and Art’s

CONCLUSION
The project entitled ' E-commerce website ' is very convenient for computer Companies. This system
is very convenient for customers and users to buy E-commerce website products. It can be observed that the
information can be obtained easily and accurately. The E-commerce website shopping Software is made more
user-friendly to the users so that anyone can run the software. Then this software provides permission to enter
to the system via the login password credentials to the user who uses this system. This project manages all the
details about the computer.
In the Future users can buy their identical products using mobile phones. This organization is very
beneficial for both users and companies. This product has great future scope. E-commerce website project
established using web-based technology and for Windows to future versions of environments. This project
also delivers security by using a security credentials like user id as well as password, so that any illegal users
cannot practice your account. The only Lawful person that will consume proper admittance authority can use
the E-commerce website shopping software.

BIBLIOGRAPHY
Books:
1. "Python Crash Course" by Eric Matthes
2. "Automate the Boring Stuff with Python" by Al Sweigart
3. "Learning Python" by Mark Lutz
4. "Python Programming: An Introduction to Computer Science" by John Zelle
5. "Fluent Python" by Luciano Ramalho
For Python :

1. W3Schools: www.w3schools.com/python
2. Python.org (Official Python Website): www.python.org
3. Real Python: realpython.com
4. Codecademy - Learn Python: www.codecademy.com/learn/learn-python
5. Coursera - Python for Everybody: www.coursera.org/specializations/python
6. Automate the Boring Stuff with Python: automatetheboringstuff.com
7. Python Crash Course: www.pythoncrashcourse.com
8. HackerRank - Python Domain: www.hackerrank.com/domains/tutorials/10-days-of-python
9. GeeksforGeeks - Python Programming Language: www.geeksforgeeks.org/python-programming-
language
10. The Hitchhiker's Guide to Python: docs.python-guide.org

E-Commerce Website 129

You might also like