Skip to content

RahatVortex98/DeshiCommerce-Django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›οΈ DeshiCommerce - Django eCommerce Web Application

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.


πŸš€ Features

  • πŸ›’ 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

πŸ§‘β€πŸ’» Tech Stack

  • 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

πŸ“ Project Structure

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

βš™οΈ Setup Instructions

1. Clone the Repository

git clone https://github.com/your-username/deshiCommerce.git
cd deshiCommerce

2. Create Virtual Environment

python -m venv venv
# Activate virtualenv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate

3. Install Requirements

pip install -r requirements.txt

4. PostgreSQL Configuration

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',
    }
}

5. Migrate Database & Create Superuser

python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser

6. Run Server

python manage.py runserver

Then visit: http://127.0.0.1:8000


✨ Admin Panel

  • URL: /admin/
  • Manage:
    • Products
    • Categories
    • Variations
    • Review ratings
    • Users

⭐ Review & Rating System

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)

🧾 Cart System

  • 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)

πŸ–ΌοΈ Media Uploads

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)

πŸ” Authentication

  • Register/Login via accounts/
  • CSRF-protected forms
  • Custom user model for future scalability

🌍 Deployment (Heroku/Render)

Environment Variables Needed:

  • DEBUG=False
  • ALLOWED_HOSTS=['yourdomain.com']
  • SECRET_KEY=your_secret_key
  • DATABASE_URL for PostgreSQL

Production Steps:

  1. Install gunicorn, whitenoise, and dj-database-url
  2. Set DEBUG=False and configure static/media settings
  3. Use collectstatic
  4. Add Procfile for Heroku

πŸ“¦ requirements.txt

Django>=5.0
psycopg2-binary
Pillow
django-crispy-forms
gunicorn
whitenoise
dj-database-url

Generate with:

pip freeze > requirements.txt

πŸ‘¨β€πŸ’» Author

Rahat
Django Developer
πŸ“§ Email / LinkedIn / Portfolio (add your links here)


verfication notregisteracc resetemaillink after click reset link after reset new password Capture variation of product bill payment review1 bill payment review 2 initial stage if ur logged in if u are not loggin after submission same user can update review must purchase for podisplaying reveiw rating sting review

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published