python manage.py createsuperuserEnter username, email, and password when prompted.
python manage.py runserver- Go to http://localhost:8000/admin
- Login with your superuser credentials
- Click "Add Category" → Create "Electronics"
- Click "Add Product" → Create a test product
- Visit http://localhost:8000
- Browse products
- Add to cart
- Proceed to checkout (optional - use test card)
| URL | What It Does |
|---|---|
| http://localhost:8000 | Home page |
| http://localhost:8000/admin | Admin panel |
| http://localhost:8000/products | Shop/catalog |
| http://localhost:8000/account/register | Sign up |
| http://localhost:8000/cart | Shopping cart |
Card Number: 4242 4242 4242 4242 Expiry: Any future date (12/25) CVC: Any 3 digits (123)
| Problem | Solution |
|---|---|
| "Module not found" | Run pip install -r requirements.txt |
| Database locked | Delete db.sqlite3 and run python manage.py migrate |
| Port in use | Run python manage.py runserver 8001 |
| Images not showing | Check /media/ folder exists |
| Static files not loading | Run python manage.py collectstatic --noinput |
ECOMMDJ/
├── manage.py ← Run Django commands
├── db.sqlite3 ← Database (auto-created)
├── templates/ ← HTML files
├── static/ ← CSS, JS, fonts
├── media/ ← User uploads (product images)
└── ecommerce/ ← Main settings folder
# Create admin user
python manage.py createsuperuser
# Start development server
python manage.py runserver
# Apply database changes
python manage.py migrate
# Create database changes from models
python manage.py makemigrations
# Enter Python shell
python manage.py shell
# Reset everything (be careful!)
python manage.py flushEdit templates/base.html, line 4:
<title>{% block title %}YOUR SITE NAME{% endblock %}</title>Edit ecommerce/settings.py, add:
PRIMARY_COLOR = '#your-color-code'Then update static/css/style.css:
--primary-color: #your-color-code;Edit ecommerce/settings.py:
STRIPE_PUBLIC_KEY = 'pk_test_YOUR_KEY'
STRIPE_SECRET_KEY = 'sk_test_YOUR_KEY'python manage.py shellfrom products.models import Category, Product
from decimal import Decimal
cat = Category.objects.create(name='Test', slug='test')
Product.objects.create(
name='Product Name',
slug='product-name',
description='Description',
price=Decimal('99.99'),
category=cat,
stock=10
)
exit()Edit templates/base.html - modify color variables in <style> tag.
Edit products/models.py:
brand = models.CharField(max_length=100, default='')Then run:
python manage.py makemigrations
python manage.py migrate- Django Docs: https://docs.djangoproject.com/
- Stripe Docs: https://stripe.com/docs
- Bootstrap Docs: https://getbootstrap.com/docs/
- Server runs without errors
- Admin login works
- Can view products
- Can add to cart
- Can view order history
- Upload real product images
- Add more products via admin
- Test the complete checkout flow
- Configure Stripe production keys
- Deploy to live server (Heroku, AWS, etc.)
You're ready to go! Happy selling! 🛍️