Medieval Auctions is a full-stack auction web application inspired by eBay, set in a medieval fantasy theme. Built with Django, Python, HTML, CSS, and SQLite, the app allows users to create listings, place bids, manage a watchlist, leave comments, and close auctions.
- Active Listings: Browse all open auction listings with title, price, description, and image.
- Create Listing: Authenticated users can post new auction items with a title, description, starting bid, optional image URL, and category.
- Bidding: Users can place bids on listings. Bids must meet or exceed the starting price and current highest bid. The listing price updates in real time.
- Watchlist: Users can add or remove listings from a personal watchlist, accessible from the navigation bar.
- Close Auction: Sellers can close their own auctions. The highest bidder is automatically marked as the winner and notified.
- Comments: Authenticated users can leave comments on any listing.
- Categories: Listings are organized by category. Clicking a category displays all listings within it.
- Django Admin: Site administrators can manage listings, users, bids, comments, and categories via the Django admin panel.
- Backend: Python, Django
- Frontend: HTML, CSS, Bootstrap
- Database: SQLite
- Authentication: Django's built-in auth system
commerce/
├── auctions/
│ ├── static/auctions/
│ │ └── styles.css
│ ├── templates/auctions/
│ │ ├── layout.html
│ │ ├── index.html
│ │ ├── listing.html
│ │ ├── create.html
│ │ ├── watchlist.html
│ │ ├── categories.html
│ │ ├── category_listings.html
│ │ ├── login.html
│ │ └── register.html
│ ├── admin.py
│ ├── models.py
│ ├── urls.py
│ └── views.py
├── commerce/
│ ├── settings.py
│ └── urls.py
└── manage.py
- User — Extends Django's
AbstractUser. Includes a ManyToManywatchlistfield linking toListing. - Category — Stores listing categories (e.g. Weapons, Armor, Food & Drink).
- Listing — Stores title, description, price, image URL, category, seller, closed status, and winner.
- Bid — Stores bid amount, the listing it belongs to, and the buyer.
- Comment — Stores comment text, the listing it belongs to, and the author.
-
Clone the repository:
git clone https://github.com/yourusername/commerce.git cd commerce -
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate -
Install dependencies:
pip install django -
Run migrations:
python manage.py makemigrations python manage.py migrate -
Create a superuser (for Django admin access):
python manage.py createsuperuser -
Start the development server:
python manage.py runserver -
Open a browser and navigate to:
http://127.0.0.1:8000 -
Access the admin panel at:
http://127.0.0.1:8000/adminUse this to add categories before creating listings.
- To start with a fresh database, delete
db.sqlite3and rerunpython manage.py migratefollowed bypython manage.py createsuperuser. - Categories must be created via the Django admin panel before they appear in the Create Listing dropdown.
- Only the seller of a listing can close its auction.
- Sellers cannot bid on their own listings.
- The winning bidder is notified with a message when they visit the listing page after the auction is closed.
- Development: Tommy Mantra
- Course: CS50W — Web Programming with Python and JavaScript
Medieval Auctions — CS50W Project 2