This project is an e-commerce application for an auction site, developed as part of the CS50 course. Users can create auction listings, place bids, comment on listings, and manage a watchlist of interesting items. The site features dynamic listings, user authentication, and category-based item browsing.
Watch the video demonstration of this project on YouTube:
- User: Extends the default Django user model.
- Auction Listing: Contains information about each auction item including title, description, starting bid, image URL, category, and current status (active or closed).
- Bid: Tracks bids placed by users on auction listings including the bid amount and the user who placed the bid.
- Comment: Stores comments made by users on auction listings.
- Watchlist: Keeps track of auction listings that users have added to their watchlist.
-
Create Listing:
- Users can create new auction listings by providing a title, description, starting bid, optional image URL, and category.
-
Active Listings Page:
- Displays all active auction listings with their title, description, current price, and image if available.
-
Listing Page:
- Shows detailed information about a specific listing.
- Users can add or remove the listing from their watchlist.
- Users can place bids on the listing if it is active.
- Listing creators can close the auction, determining the highest bidder as the winner.
- Users can add comments to the listing.
-
Watchlist:
- Users can view and manage listings they are interested in.
-
Categories:
- Users can browse listings by category.
-
Django Admin Interface:
- Administrators can manage all listings, bids, and comments.
-
Clone the repository:
git clone https://github.com/Ayushma00/e-commerce-application.git
-
Navigate to the project directory:
cd auction-site
-
Create a virtual environment:
python -m venv env
-
Activate the virtual environment:
- On Windows:
.\env\Scripts\activate
- On MacOS/Linux:
source env/bin/activate
- On Windows:
-
Install the dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Create a superuser for the admin interface:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
- Home Page: View all active listings.
- Create Listing: Create a new auction listing by filling out the form.
- Listing Details: Click on any listing to view its details, place bids, comment, or add to the watchlist.
- Watchlist: Manage your watchlist by adding or removing listings.
- Categories: Browse listings by categories.
- Admin Interface: Administrators can manage listings, bids, and comments through the Django admin interface.
Extends the AbstractUser
model provided by Django.
- seller:
ForeignKey(User)
- The user who created the listing. - title:
CharField(max_length=100)
- The title of the listing. - description:
TextField
- Detailed description of the item. - category:
CharField(max_length=3, choices=CATEGORY)
- Category of the item. - price:
DecimalField(max_digits=11, decimal_places=2)
- The current price of the listing. - image:
URLField
- URL for an image of the item. - published_date:
DateTimeField(auto_now_add=True)
- The date the listing was published. - close_bid:
BooleanField(default=False)
- Status of the listing (active/closed).
- auction:
ForeignKey(AuctionListing)
- The listing on which the bid is placed. - user:
ForeignKey(User)
- The user who placed the bid. - bid_price:
DecimalField(max_digits=11, decimal_places=2)
- The bid amount. - bid_date:
DateTimeField(auto_now_add=True)
- The date the bid was placed.
- auction:
ForeignKey(AuctionListing)
- The listing on which the comment is made. - user:
ForeignKey(User)
- The user who made the comment. - comments:
TextField
- The text of the comment. - time:
DateTimeField(auto_now_add=True)
- The time the comment was made.
- auction:
ForeignKey(AuctionListing)
- The listing added to the watchlist. - seller:
ForeignKey(User)
- The user who added the listing to the watchlist.
- Listings: View, add, edit, and delete listings.
- Bids: View, add, edit, and delete bids.
- Comments: View, add, edit, and delete comments.
This project is licensed under the MIT License. See the LICENSE file for details.
- CS50 Course Material: CS50x 2021
- Django Documentation: https://docs.djangoproject.com/
- Bootstrap for styling: https://getbootstrap.com/