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.
-
Product Listing:
- Users can view a list of available products, including their names, descriptions, prices, and images.
-
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.
-
Cart Management:
- Users can view their cart, update quantities, and remove items.
-
Checkout with PayPal:
- Users can proceed to checkout and pay for their items using PayPal. The project uses PayPal's sandbox environment for testing.
-
Order Management:
- After a successful payment, orders are saved in the database, and the cart is cleared.
-
Responsive Design:
- The website is fully responsive and works seamlessly on all devices (desktop, tablet, and mobile).
-
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)
- 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.
- 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.
- 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.
- Admins can view all orders and transactions in the Django admin panel.
Follow these steps to set up the project on your local machine:
git clone https://github.com/ndongchrist/Django-Paypal.git
cd Django-Paypal
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
Open your browser and go to:
http://localhost:8000/
-
Create a PayPal Sandbox Account:
- Go to the PayPal Developer Dashboard.
- Create a sandbox business account and a sandbox personal account.
-
Update PayPal Settings:
- In
settings.py
, update the following:PAYPAL_TEST = True # Use PayPal sandbox PAYPAL_RECEIVER_EMAIL = 'your-sandbox-business-email@example.com'
- In
-
Test Payments:
- Use the sandbox personal account to simulate payments.
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
I created a YouTube video to walk you through this project step-by-step. Watch it here: [Insert YouTube Video Link]
If you'd like to contribute to this project, feel free to:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeatureName
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/YourFeatureName
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- 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! 🚀