Shopnow (E‑Kart) is a full‑stack, production-ready e‑commerce web application built using the Django framework. It provides a complete shopping experience, allowing users to register, log in, browse products by category, manage their shopping cart, and securely place orders using the Razorpay payment gateway.
The project strictly adheres to Django’s MTV (Model‑Template‑View) architecture and uses Bootstrap 5 and Axios to deliver a responsive, dynamic frontend.
- Secure user registration, login, and logout.
- Forgot Password functionality.
- Dedicated user profile to view order history.
- Dynamic product listing with clear pricing and unit details.
- Categorized browsing (Fruits, Vegetables, Groceries, etc.).
- Image handling via Django Media.
- Search functionality to quickly find products.
- AJAX-powered Add to Cart functionality (no page reloads).
- Real-time cart quantity updates (+/- controls).
- Automatic calculation of delivery and handling charges based on the cart total.
- Razorpay payment gateway integration.
- Secure online transaction handling and verification.
- Order creation only upon successful payment verification.
- Detailed order history accessible to users.
- Order status tracking (Pending, Paid, Completed, etc.).
- Admin capabilities to view and manage all orders.
| Component | Technology |
|---|---|
| Backend Framework | Python 3.11, Django 5.1.4 |
| Frontend | HTML5, CSS3, Bootstrap 5, JavaScript (Axios for AJAX) |
| Database | MySQL (configured via django-environ) |
| Payment Gateway | Razorpay API |
| Authentication | Django Auth System |
- MTV (Model-Template-View)
- AJAX-based client–server communication using Axios
- REST-style Django views for cart & order actions
- Separation of concerns between UI, logic, and data
- Secure authentication & CSRF protection
Shopnow/
│
├── apps/
│ └── shop/ # Core application (Models, Views, URLs, Forms)
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── forms.py
│ ├── models.py
│ ├── urls.py
│ ├── views.py
│ │
│ ├── migrations/
│ │ └── __init__.py
│ │
│ └── templatetags/
│ └── custom_tags.py
│
├── config/ # Django project configuration & settings
│ ├── __init__.py
│ ├── urls.py # Project routing
│ ├── wsgi.py # WSGI entrypoint
│ │
│ └── settings/ # Django settings module
│ ├── __init__.py
│ ├── base.py
│ ├── dev.py
│ └── prod.py
│
├── media/
│ ├── images/
│ └── media/
│ └── images/
│
├── static/ # CSS, JavaScript (Axios logic), and UI assets
│
├── template/ # Global HTML Templates (Bootstrap components)
│
├── .gitignore
├── README.md
├── manage.py # Django project launcher
└── requirements.txt # Dependencies list
Before you begin, ensure you have the following installed on your machine:
- Python 3.10+
- MySQL Server (Running locally or remotely)
- Git
git clone [https://github.com/Sairaj-25/django_shopnow.git](https://github.com/Sairaj-25/django_shopnow.git)
cd django_shopnow- Isolate your project dependencies:
python -m venv venv- Windows
venv\Scripts\activate
- macOS / Linux
source venv/bin/activate
pip install -r requirements.txt- Create a .env file in the root directory (alongside manage.py) and add your database credentials and API keys:
# Django Settings
DJANGO_SECRET_KEY="your-super-secret-django-key"
DEBUG=True
# Database Configuration (MySQL)
DB_NAME="your_db_name"
DB_USER="root"
DB_PASSWORD="your_db_password"
DB_HOST="127.0.0.1"
DB_PORT="3306"
# Razorpay API Keys
RAZOR_KEY_ID="your_razorpay_key_id"
RAZOR_KEY_SECRET="your_razorpay_key_secret"
- Make sure you create the corresponding MySQL database (DB_NAME) on your MySQL server before running migrations.
CREATE DATABASE your_db_name;
- Initialize the database and apply the schema:
python manage.py makemigrationspython manage.py migratepython manage.py createsuperuserpython manage.py runserverOpen your browser and navigate to: http://127.0.0.1:8000/
- Access the Django admin dashboard at:
http://127.0.0.1:8000/admin/
-
From here, you can:
-
Add and manage Products & Categories.
-
Monitor incoming Orders and Payments.
-
Manage Users and Customers.
User → Register Page → Form Validation → User Created → Redirect to Home
User → Login Page → Credentials Check → Session Created → Home Page
User → Home Page → Product List → Product Card → Price & Unit Display
User → Click Add to Cart → Product ID Captured → Cart Updated → Quantity Control
User → Checkout → Razorpay Payment → Payment Verification → Order Created → Order History Updated (MySQL)
User → Logout → Session Destroyed → Redirect to Home
- Pagination for products
- Invoice generation (PDF)
- Order cancellation & refunds
- REST API for mobile app
- Docker & cloud deployment (AWS)
- Advanced sales analytics dashboard
Sairaj Jadhav