A complete, feature-rich online shopping platform built with Django, featuring beautiful UI, secure payments, and intelligent recommendations.
๐ฌ Watch Demo Video Here
Whether you're a business owner looking to sell online, a developer learning e-commerce, or just curious about modern web applications, this guide will help you get MyShop up and running in no time!
- Small Business Owners - Launch your online store quickly
- Developers - Learn Django and e-commerce best practices
- Students - Study real-world web development
- Entrepreneurs - Get a head start on your e-commerce venture
- Browse Products with beautiful, responsive design
- Smart Shopping Cart that saves items between visits
- Secure Checkout with multiple payment options
- Coupon Codes for discounts and promotions
- Multi-language Support (English & Spanish included)
- PDF Receipts sent automatically via email
- Easy Product Management through admin interface
- Order Processing with automatic email notifications
- Sales Analytics and reporting
- Coupon Management for marketing campaigns
- Inventory Tracking and low-stock alerts
- Customer Database with purchase history
- Modern Django 4.x with best practices
- Asynchronous Tasks using Celery
- Payment Integration with Braintree
- Internationalization ready out of the box
- Redis Caching for performance
- Comprehensive Testing suite included
Before we begin, make sure you have these installed:
For Everyone:
- A computer with internet connection
- A web browser (Chrome, Firefox, Safari, etc.)
For Technical Setup:
- Python 3.8 or newer (Download here)
- Git (Download here)
Not sure if you have Python? Open your terminal/command prompt and type:
python --versionOption A: Using Git (Recommended)
git clone https://github.com/dennismbugua/online-shop.git
cd myshopOption B: Download ZIP
- Click the green "Code" button on GitHub
- Select "Download ZIP"
- Extract the files to your desired location
Create a Virtual Environment (This keeps your project isolated)
# Create virtual environment
python -m venv myshop-env
# Activate it (Windows)
myshop-env\Scripts\activate
# Activate it (Mac/Linux)
source myshop-env/bin/activateInstall Required Packages
pip install -r requirements.txtCreate Environment File
# Copy the example file
cp .env.example .envEdit Your Settings (Open .env file in any text editor)
# Basic Settings
DEBUG=True
SECRET_KEY=your-secret-key-here
# Email Settings (Optional for testing)
EMAIL_HOST=smtp.gmail.com
[email protected]
EMAIL_HOST_PASSWORD=your-app-password
# Payment Settings (Use Braintree Sandbox for testing)
BRAINTREE_MERCHANT_ID=your-sandbox-merchant-id
BRAINTREE_PUBLIC_KEY=your-sandbox-public-key
BRAINTREE_PRIVATE_KEY=your-sandbox-private-keyDon't worry! These settings are optional for basic testing. The app will work without them.
# Navigate to the main project folder
cd myshop
# Create database tables
python manage.py migrate
# Create an admin user (you'll use this to manage your store)
python manage.py createsuperuserWhen creating superuser:
- Enter a username (e.g., "admin")
- Enter your email
- Create a password (you'll need this later!)
Want to see MyShop in action immediately? Load some sample data:
python manage.py loaddata sample_products.jsonThis adds example products so you can test the shopping experience right away!
python manage.py runserver๐ Congratulations! Your store is now running at:
- Main Store: http://127.0.0.1:8000
- Admin Panel: http://127.0.0.1:8000/admin
Visit http://127.0.0.1:8000/admin and log in with your superuser credentials.
Adding Products:
- Click "Products" โ "Add Product"
- Fill in product details:
- Name and description
- Price and category
- Upload product images
- Set availability
- Click "Save"
Managing Orders:
- Go to "Orders" section
- View all customer orders
- Update order status
- Export to CSV for accounting
Creating Coupons:
- Navigate to "Coupons"
- Set discount percentage
- Choose validity dates
- Share codes with customers
Shopping Flow:
- Browse products by category
- Add items to cart
- Apply coupon codes (optional)
- Proceed to checkout
- Fill shipping information
- Complete secure payment
- Receive confirmation email with PDF receipt
Special Features:
- Smart Recommendations: "Customers who bought this also bought..."
- Multi-language: Switch between English and Spanish
- Mobile Friendly: Works perfectly on phones and tablets
- Fast Loading: Optimized for speed
- Sign up for Braintree at braintreepayments.com
- Get your credentials from the Braintree dashboard
- Update your .env file with real credentials
- Test with real cards in sandbox mode first
Security Note: Never commit real payment credentials to version control!
For Gmail:
- Enable 2-factor authentication
- Create an "App Password"
- Use the app password in your .env file
For Other Providers: Update the EMAIL_HOST settings in your .env file accordingly.
Set up Redis (Optional but Recommended):
# Install Redis
# Ubuntu/Debian:
sudo apt-get install redis-server
# macOS:
brew install redis
# Start Redis
redis-serverSet up Background Tasks:
# In a new terminal, start Celery worker
celery -A myshop worker -l info
# Optional: Start monitoring interface
celery -A myshop flowerColors and Styling:
- Edit
static/css/style.cssfor global styles - Modify templates in
templates/folder - Add your logo to
static/images/
Adding Your Branding:
- Replace logo in header template
- Update color scheme in CSS
- Modify email templates with your branding
# Create translation files
python manage.py makemessages -l fr # French example
# Edit translations in locale/fr/LC_MESSAGES/django.po
# Compile translations
python manage.py compilemessagesThe codebase is designed to be extensible:
- Product Reviews: Add rating system
- Wishlist: Let customers save favorites
- Social Login: Integrate with Google/Facebook
- Analytics: Add Google Analytics tracking
"Port already in use" Error:
# Kill process on port 8000
sudo lsof -t -i tcp:8000 | xargs kill -9
# Or use a different port
python manage.py runserver 8001"Module not found" Errors:
# Make sure virtual environment is activated
source myshop-env/bin/activate # Mac/Linux
myshop-env\Scripts\activate # Windows
# Reinstall requirements
pip install -r requirements.txtDatabase Issues:
# Reset database (WARNING: This deletes all data!)
rm db.sqlite3
python manage.py migrate
python manage.py createsuperuserEmail Not Sending:
- Check your email settings in .env
- For Gmail, ensure you're using an App Password
- Check spam folder for test emails
- Add More Products using the admin interface
- Set Up Analytics to track sales and customer behavior
- Create Marketing Campaigns using the coupon system
- Optimize for Search Engines with product descriptions
- Scale Your Infrastructure when you get more traffic
- Django - The web framework for perfectionists with deadlines
- Bootstrap - Beautiful, responsive design components
- Braintree - Secure payment processing
- Celery - Distributed task queue
- Redis - In-memory data structure store
- Followed the installation steps
- Added your first product
- Tested the checkout process
- Configured email settings
- Set up payment processing
โญ If MyShop helped you, please star this repository and share it with others!
Happy Selling! ๐
Made with โค๏ธ by Dennis