The Django Book Shop is a web application designed to facilitate the sale and purchase of books. Built using Django, it includes features such as user authentication, browsing books, adding books to a shopping cart, placing orders, and processing payments through PayPal.
- User authentication and registration
- Browse books
- Add books to a shopping cart
- View and update cart items
- Place orders securely using PayPal for payment processing
Ensure you have Python and pip installed on your system.
-
Clone the repository:
git clone /~https://github.com/munuhee/books_shop.git cd books_shop
-
Install dependencies:
pip install -r requirements.txt
-
Configure Django settings:
-
Create a file named
.env
. -
Update the
.env
file with your Django secret key and PayPal configurations:SECRET_KEY='your-django-secret-key' PAYPAL_CLIENT_ID='your-paypal-client-id' PAYPAL_SECRET='your-paypal-secret' EMAIL_HOST='smtp.example.com' EMAIL_PORT=587 EMAIL_USE_TLS=True EMAIL_HOST_USER='your_email@example.com' EMAIL_HOST_PASSWORD='your_email_password'
On
checkout.html
file replaceYOUR_CLIENT_ID
with your client id from paypal
-
-
Run database migrations:
python manage.py migrate
-
Create a superuser (admin):
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
The application will be accessible at
http://localhost:8000
. -
Access the admin interface:
- Manage books and users via the Django admin interface at
http://localhost:8000/admin/
.
- Manage books and users via the Django admin interface at
-
Sign up (registration):
- Users can register for an account to start purchasing books.
-
Browse books:
- Browse through categories and lists of available books.
-
Add to cart:
- Add desired books to the shopping cart for checkout.
-
Checkout:
- Proceed to checkout, review cart items, and enter payment details.
We welcome contributions! To contribute to the project, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name
). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature/your-feature-name
). - Create a new Pull Request.
- This project was created as part of learning Django and integrating PayPal for payment processing.
- Thanks to the Django and PayPal communities for their valuable documentation and resources.
Happy coding!