DeshiCommerce is a full-featured, dynamic eCommerce web application built using Django and PostgreSQL. It includes everything you need to run an online store: product listings, variations (color/size), add-to-cart functionality, customer reviews and ratings, user authentication, admin controls, and more.
Designed to be clean, professional, and fully scalable.
- π Product listing with category filtering
- π Product detail pages with image gallery and variations
- ποΈ Add to cart with stock check
- π§Ύ Dynamic cart system
- β Customer reviews and star-based rating system (0.5 to 5 stars)
- π User registration, login, and logout
- π§ Admin dashboard via Django Admin
- πΌοΈ Media uploads for product images
- π Auto timestamps for reviews and products
- π§ Smart review handling (only one review per user per product; updatable)
- π± Responsive UI using Bootstrap
- Backend: Django 5.x
- Frontend: HTML5, Bootstrap, Font Awesome
- Database: PostgreSQL
- Authentication: Djangoβs built-in auth system
- Reviews & Ratings: Custom
ReviewRating
model with rating radio buttons - Cart System: Session-based, supports variations
deshiCommerce/
βββ accounts/ # User model and auth views
βββ store/ # Product, Category, ReviewRating models
βββ carts/ # Cart and cart items
βββ templates/
β βββ base.html
β βββ store/
β β βββ product_detail.html
β β βββ category.html
βββ static/ # CSS, JS, and images
βββ media/ # Uploaded product images
βββ manage.py
βββ requirements.txt
βββ db.postgresql
git clone https://github.com/your-username/deshiCommerce.git
cd deshiCommerce
python -m venv venv
# Activate virtualenv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
pip install -r requirements.txt
Update the DATABASES
section in settings.py
:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'your_db_name',
'USER': 'your_db_user',
'PASSWORD': 'your_db_password',
'HOST': 'localhost',
'PORT': '5432',
}
}
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
Then visit: http://127.0.0.1:8000
- URL:
/admin/
- Manage:
- Products
- Categories
- Variations
- Review ratings
- Users
Each product has its own review section:
- Logged-in users can:
- Submit one review per product
- Edit their review later
- Rating uses 0.5 to 5 stars
- Star icons rendered dynamically with logic
- Review model:
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.DecimalField(max_digits=2, decimal_places=1)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
- Session-based cart with variation handling
- Select color and size (if applicable) before adding to cart
- Quantity and stock managed dynamically
- Cart stored per user (or session if not logged in)
Images for products are stored in /media/
. Make sure to configure:
MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'media'
Add in urls.py
:
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
- Register/Login via
accounts/
- CSRF-protected forms
- Custom user model for future scalability
DEBUG=False
ALLOWED_HOSTS=['yourdomain.com']
SECRET_KEY=your_secret_key
DATABASE_URL
for PostgreSQL
- Install
gunicorn
,whitenoise
, anddj-database-url
- Set
DEBUG=False
and configure static/media settings - Use
collectstatic
- Add Procfile for Heroku
Django>=5.0
psycopg2-binary
Pillow
django-crispy-forms
gunicorn
whitenoise
dj-database-url
Generate with:
pip freeze > requirements.txt
Rahat
Django Developer
π§ Email / LinkedIn / Portfolio (add your links here)