A full-featured, modern e-commerce bookstore built with Django, featuring PayPal payments, beautiful UI/UX, and comprehensive order management.
- E-commerce Ready: Complete online bookstore with cart, checkout, and payment processing
- Scalable Architecture: Built on Django framework for enterprise-level scalability
- Payment Integration: Secure PayPal integration with sandbox testing capabilities
- Modern UI/UX: Professional design that converts visitors to customers
- Order Management: Complete order tracking and email notifications
- Mobile Responsive: Works perfectly on all devices and screen sizes
- π Independent Bookstores transitioning to online sales
- π’ Publishers selling directly to consumers
- π Educational Institutions selling course materials
- π₯ Book Clubs and literary communities
- π± Digital Marketplaces for books and publications
- Product Catalog: Browse books by categories, authors, and genres
- Shopping Cart: Add/remove items with real-time updates
- Secure Checkout: Multi-step checkout process with validation
- Payment Processing: PayPal integration with sandbox testing
- Order Management: Complete order tracking and history
- Responsive Design: Mobile-first approach with Bootstrap integration
- Animated Interactions: Smooth animations with AOS (Animate On Scroll)
- Professional Styling: Glass-morphism effects and gradient designs
- Enhanced Forms: Beautiful form validation and user feedback
- Interactive Elements: Hover effects, loading states, and micro-interactions
- Django 5.0.4: Latest Django framework with modern features
- PostgreSQL Ready: Database configuration for production
- HTTPS Support: SSL/TLS encryption for secure transactions
- Email Notifications: Beautiful HTML emails for order confirmations
- Environment Configuration: Secure configuration with .env files
- Country Selection: Global country support with django-countries
Click Here to Watch the Full Demo Video Here π
- Product browsing and search functionality
- Adding items to cart and checkout process
- PayPal payment integration
- Order confirmation and email notifications
- Admin panel features
- Responsive design on different devices
- Python 3.8+
- pip (Python package manager)
- Git
- PostgreSQL (optional, uses SQLite by default)
git clone https://github.com/yourusername/django-bookstore.git
cd django-bookstore# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the project root:
# Django Configuration
SECRET_KEY=your-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1,0.0.0.0
# PayPal Configuration
PAYPAL_TEST=True
PAYPAL_CLIENT_ID=your-paypal-client-id
PAYPAL_CLIENT_SECRET=your-paypal-client-secret
PAYPAL_BUSINESS_EMAIL=your-sandbox-business-email
# Email Configuration
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=your-email@gmail.com
EMAIL_HOST_PASSWORD=your-app-password
DEFAULT_FROM_EMAIL=your-email@gmail.com
# Shipping Configuration
SHIPPING_COST=100
# SSL Configuration
SECURE_SSL_REDIRECT=False
SECURE_PROXY_SSL_HEADER_NAME=HTTP_X_FORWARDED_PROTO
SECURE_PROXY_SSL_HEADER_VALUE=https# Run migrations
python manage.py makemigrations
python manage.py migrate
# Create superuser
python manage.py createsuperuser# Load sample books and categories
python manage.py loaddata fixtures/sample_data.json# HTTP (development)
python manage.py runserver
# HTTPS (for PayPal testing)
python manage.py runsslserverVisit https://127.0.0.1:8000 to see your bookstore!
- Go to PayPal Developer
- Sign in or create an account
- Navigate to "My Apps & Credentials"
- Click "Create App"
- Choose "Sandbox" environment
- Select "Merchant" account type
- Note down your Client ID and Client Secret
- Go to "Sandbox" β "Accounts"
- Create a Business Account (for receiving payments)
- Create a Personal Account (for making test payments)
- Fund the personal account with test money
Add your credentials to the .env file:
PAYPAL_CLIENT_ID=your-sandbox-client-id
PAYPAL_CLIENT_SECRET=your-sandbox-client-secret
PAYPAL_BUSINESS_EMAIL=your-sandbox-business-emaildjango-bookstore/
βββ bookstore/ # Main project directory
β βββ settings.py # Django settings
β βββ urls.py # Main URL configuration
β βββ wsgi.py # WSGI configuration
βββ store/ # Store app (products, categories)
β βββ models.py # Book, Category models
β βββ views.py # Store views
β βββ templates/ # Store templates
β βββ static/ # CSS, JS, images
βββ cart/ # Shopping cart app
β βββ cart.py # Cart session management
β βββ views.py # Cart views
β βββ templates/ # Cart templates
βββ order/ # Order management app
β βββ models.py # Order, OrderItem models
β βββ views.py # Order and PayPal views
β βββ templates/ # Order templates
βββ templates/ # Global templates
βββ static/ # Global static files
βββ requirements.txt # Python dependencies
βββ .env.example # Environment variables example
βββ manage.py # Django management script
- Update
ORDER_PAYMENT_CHOICESinorder/models.py - Add payment fields in
order/templates/order/order.html - Create payment processing views in
order/views.py - Add corresponding URL patterns
- Edit templates in
order/templates/order/emails/ - Update email context in
order/views.py - Customize CSS styles for better branding
- Update
Bookmodel instore/models.py - Create and run migrations
- Update templates to display new fields
- Add form fields if needed
DEBUG=False
ALLOWED_HOSTS=yourdomain.com,www.yourdomain.com
PAYPAL_TEST=False
SECURE_SSL_REDIRECT=True- Heroku: Easy deployment with PostgreSQL addon
- DigitalOcean: App Platform or Droplets
- AWS: Elastic Beanstalk or EC2
- Railway: Modern platform with simple deployment
- Update
ALLOWED_HOSTSwith your domain - Set
DEBUG=Falsein production - Use PostgreSQL for production database
- Configure proper email backend (SendGrid, SES, etc.)
- Set up SSL certificate
- Configure static files serving (WhiteNoise, S3, etc.)
- Switch to live PayPal credentials
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
PayPal "Something doesn't look right" Error
- Ensure you're using sandbox business email in settings
- Check that Client ID matches your sandbox app
- Verify you're logged in as a buyer (personal account) not seller
CSRF Token Errors
- Check
ALLOWED_HOSTSconfiguration - Ensure
.envfile is properly loaded - Verify HTTPS is enabled for PayPal callbacks
Email Not Sending
- Check email configuration in
.env - Use app-specific passwords for Gmail
- Verify SMTP settings with your email provider
- Django community for the amazing framework
- PayPal for payment processing capabilities
- Bootstrap for responsive design components
- Font Awesome for beautiful icons
- AOS library for smooth animations
β If this project helped you, please give it a star on GitHub!
Built with β€οΈ for the book-loving community