A Django-based auction platform where users can create listings, place bids, add items to their watchlist, and interact through comments.
- User Authentication: Register, login, and logout functionality
- Create Listings: Users can create auction listings with:
- Title and description
- Starting price
- Category
- Image URL
- Bidding System: Place bids on active listings with validation to ensure bids exceed current prices
- Watchlist: Save favorite listings for quick access
- Categories: Browse listings by category
- Comments: Add comments to listings
- Listing Management: Owners can close their listings
- Framework: Django 3.2+
- Database: SQLite (default) - easily configurable for PostgreSQL/MySQL
- UI Components: Django Cotton + shadcn-django
- Styling: Tailwind CSS
- Python 3.7 or higher
- pip (Python package installer)
-
Clone the repository
git clone https://github.com/yourusername/fahdjud.git cd fahdjud -
Create a virtual environment
python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
Copy
.env.exampleto.envand configure your settings:cp .env.example .env
Edit
.envand set:SECRET_KEY: Generate a secure secret keyDEBUG: Set toTruefor development,Falsefor productionALLOWED_HOSTS: Add your domain names (comma-separated)CSRF_TRUSTED_ORIGINS: Add trusted origins for CSRF protection
-
Make database migrations
python manage.py makemigrations
-
Apply database migrations
python manage.py migrate auctions
-
Create a superuser (admin)
python manage.py createsuperuser
-
Load initial categories (optional)
You can add categories through the Django admin panel or create a data fixture.
-
Run the development server
python manage.py runserver
Visit
http://localhost:8000in your browser.
- Register: Create an account to start using the platform
- Browse Listings: View all active auction listings on the homepage
- Filter by Category: Browse listings in specific categories
- View Details: Click on a listing to see full details, current bid, and comments
- Place Bids: Enter a bid amount higher than the current price
- Add to Watchlist: Save interesting listings to your watchlist
- Comment: Share your thoughts on listings
- Create Listing: Click "Create Listing" to auction an item
- Set Details: Add title, description, starting price, category, and image
- Monitor Bids: See all bids placed on your listings
- Close Listing: When ready, close the listing to end the auction
Access the admin panel at http://localhost:8000/admin to:
- Manage users
- Add/edit categories
- Moderate listings and comments
- View all bids
.
├── auctions/ # Main application
│ ├── models.py # Database models (User, Listing, Category, Comment, Action)
│ ├── views.py # View functions
│ ├── urls.py # URL routing
│ ├── templates/ # HTML templates
│ └── static/ # Static files (CSS, JS, images)
├── commerce/ # Project settings
│ ├── settings.py # Django settings
│ ├── urls.py # Root URL configuration
│ └── wsgi.py # WSGI configuration
├── templates/ # Shared templates
├── static/ # Global static files
├── manage.py # Django management script
├── requirements.txt # Python dependencies
├── .env.example # Environment variable template
└── README.md # This file
- User: Extended Django user model
- Category: Listing categories
- Listing: Auction listings with title, description, price, owner, category, and active status
- Comment: User comments on listings
- Action: Bid records with price and timestamp
| Variable | Description | Default |
|---|---|---|
SECRET_KEY |
Django secret key | Required |
DEBUG |
Debug mode | False |
ALLOWED_HOSTS |
Allowed hostnames | localhost,127.0.0.1 |
CSRF_TRUSTED_ORIGINS |
Trusted origins for CSRF | http://localhost:8000 |
- Never commit the
.envfile to version control - Never commit
db.sqlite3- it may contain sensitive user data - Generate a strong
SECRET_KEYfor production - Set
DEBUG=Falsein production - Use HTTPS in production and update
CSRF_TRUSTED_ORIGINSaccordingly - Consider using a production database (PostgreSQL/MySQL) instead of SQLite
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT License.
- Built with Django
- UI components powered by Django Cotton and shadcn-django
- Styled with Tailwind CSS
For issues, questions, or contributions, please open an issue on GitHub.
Note: This is a learning/portfolio project. For production use, additional security hardening, testing, and optimizations are recommended.
