Skip to content

Latest commit

 

History

History
179 lines (126 loc) · 5.05 KB

README.md

File metadata and controls

179 lines (126 loc) · 5.05 KB

🛒 E-Commerce Website with PayPal Integration

Welcome to my E-Commerce Website project! This is a simple yet fully functional online store where users can browse products, add them to their cart, and complete purchases using PayPal. The project is built with Django (a Python web framework) and uses Bootstrap for styling.


🚀 Features

  1. Product Listing:

    • Users can view a list of available products, including their names, descriptions, prices, and images.
  2. Add to Cart:

    • Users can add products to their cart. The cart is stored in the browser's local storage, so items persist even if the page is refreshed.
  3. Cart Management:

    • Users can view their cart, update quantities, and remove items.
  4. Checkout with PayPal:

    • Users can proceed to checkout and pay for their items using PayPal. The project uses PayPal's sandbox environment for testing.
  5. Order Management:

    • After a successful payment, orders are saved in the database, and the cart is cleared.
  6. Responsive Design:

    • The website is fully responsive and works seamlessly on all devices (desktop, tablet, and mobile).

🛠️ Technologies Used

  • Backend:

    • Django (Python web framework)
    • Django PayPal Integration (django-paypal)
  • Frontend:

    • HTML, CSS, JavaScript
    • Bootstrap (for styling)
    • Font Awesome (for icons)
  • Database:

    • SQLite (default Django database)
  • Payment Gateway:

    • PayPal Sandbox (for testing payments)

🎥 How It Works

1. Product Listing Page

  • Users can browse all available products.
  • Each product has a "Buy Now" button for direct checkout and an "Add to Cart" button to add the product to the cart.

2. Cart Page

  • Users can view all items in their cart.
  • The cart displays the product name, price, quantity, and total price for each item.
  • Users can remove items from the cart.

3. Checkout Process

  • When users click "Proceed to Checkout", they are redirected to PayPal to complete the payment.
  • After a successful payment, the order is saved in the database, and the cart is cleared.

4. Order Management

  • Admins can view all orders and transactions in the Django admin panel.

🛠️ Installation Guide

Follow these steps to set up the project on your local machine:

1. Clone the Repository

git clone https://github.com/ndongchrist/Django-Paypal.git
cd Django-Paypal

2. Set Up a Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Set Up the Database

python manage.py migrate

5. Create a Superuser (Admin)

python manage.py createsuperuser

6. Run the Development Server

python manage.py runserver

7. Access the Website

Open your browser and go to:

http://localhost:8000/

🔑 Setting Up PayPal

  1. Create a PayPal Sandbox Account:

  2. Update PayPal Settings:

    • In settings.py, update the following:
      PAYPAL_TEST = True  # Use PayPal sandbox
      PAYPAL_RECEIVER_EMAIL = 'your-sandbox-business-email@example.com'
  3. Test Payments:

    • Use the sandbox personal account to simulate payments.

📂 Project Structure

ecommerce/
├── ecommerce/               # Django project settings
├── store/                   # Django app (products, cart, checkout)
│   ├── migrations/          # Database migrations
│   ├── templates/           # HTML templates
│   ├── admin.py             # Admin configuration
│   ├── models.py            # Database models
│   ├── views.py             # Views (logic)
│   └── urls.py              # App-specific URLs
├── manage.py                # Django management script
└── requirements.txt         # Project dependencies

🎬 YouTube Video

I created a YouTube video to walk you through this project step-by-step. Watch it here: [Insert YouTube Video Link]


🤝 Contributing

If you'd like to contribute to this project, feel free to:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeatureName).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/YourFeatureName).
  5. Open a pull request.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.


🙏 Acknowledgments

  • Django for the awesome web framework.
  • PayPal for the easy-to-use payment gateway.
  • Bootstrap for the responsive design.

Enjoy building your own e-commerce website! If you have any questions, feel free to reach out. Happy coding! 🚀