A full-stack E-commerce platform built with Django and Django REST Framework, designed for secure authentication, payment processing, order tracking, user management capabilities and a seamless shopping experience.
๐ Authentication System
- User sign-up/sign-in with OAuth2.0 (Google login)
- Email verification & password management
- TOTP-based 2FA with backup codes for account safety
๐๏ธ Products & Catalog
- Product listing with search & filters
- Category-based browsing
๐ณ Card Payment Integration
- Secure credit/debit card transactions powered by Stripe API
๐ Cart Management
- Session-based carts for guests
- Persistent model-based carts for registered users
๐ฆ Order Management
- Complete order lifecycle: creation, tracking, and admin management
โญ Review System
- Users can add reviews
- Owner-only edit/delete permissions to maintain authenticity
๐ Address Management
- Add, update, and manage multiple shipping addresses
- Backend: Python, Django, Django REST Framework
- Frontend: HTML, CSS, JavaScript
- Database: SQLite
- Payment Gateway Integration: Stripe
๐ Click here to watch project demo video.
To run this project successfully, ensure you have the following:
-
Python 3.12+
-
Email account with password (recommended: use an app password instead of your primary email password)
-
Google OAuth Credentials (for Social Login): create a Google OAuth Client ID and Client Secret from the Google Cloud Console
-
Stripe Account & API Keys (for Payment Processing). You can create an account from here Stripe
-
Live URL for Webhooks (Ngrok Recommended). You can install it from here Ngrok
git clone https://github.com/raghav-patidar1/django-ekart.git
cd django-ekartpython -m venv venv
source venv/bin/activate # On Linux/Mac
venv\Scripts\activate # On Windowspip install -r requirements.txt-
Open ngrok and start a tunnel to your django server.
ngrok http 8000
-
Copy the generated HTTPS forwarding URL (e.g.,
https://myproject-12345.ngrok.io) and use this as your live URL for webhooks and update.envfile accordingly (as explained below).
-
Login to Stripe.
-
Copy Stripe Secret Key from dashboard.
-
In your Stripe Dashboard โ Developers โ Webhooks, click on
+ Add Destination -
Select
Checkout events(e.g., checkout.session.completed or select all checkout events). -
Select
Webhook endpoint as destination typeand add an endpoint URL.<your-live-url>/orders/stripe/webhook/
For example:
https://myproject-12345.ngrok.io/orders/stripe/webhook/
Copy the Stripe Secret Key and Webhook Secret, you will need them during setting up environment variables
-
Copy
.env.exampleโ.env:cp .env.example .env
-
Fill in your credentials (Google, Stripe, Django settings).
Example
.envconfiguration file for a live server.
SECRET_KEY=<your-secret-key>
DEBUG=True
EMAIL_HOST_USER='your-email-address'
EMAIL_HOST_PASSWORD='your-app-password-without-space'
# Example for HTTP (port 80)
SITE_SCHEME=http
SITE_DOMAIN=<live domain>
SITE_PORT=80
# Example for HTTPS (port 443)
SITE_SCHEME=https
SITE_DOMAIN=<live domain>
SITE_PORT=443
STRIPE_SECRET_KEY=<your-stripe-secret sk_test_...>
STRIPE_WEBHOOK_SECRET=<your-webhook-secret whsec_...>
GOOGLE_CLIENT_ID=<your-client-id>
GOOGLE_CLIENT_SECRET=<your-client-secret>
SITE_DOMAIN=myproject-12345.ngrok.io
To generate a Django secret key:
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"python manage.py makemigrations
python manage.py migratepython manage.py createsuperuserpython manage.py runserver- Visit your Ngrok live URL in the browser:
https://myproject-12345.ngrok.io
- Log in to the Django admin (/admin/).
- Add Categories and Products.
- Configure store settings from StoreConfig model (shipping charges and tax rate)