Welcome to the Django E-commerce App repository! This project is an E-commerce API built using the Django REST Framework (DRF). It provides a robust backend solution for managing online stores, supporting user authentication through Google OAuth and JWT. You can explore endpoints for managing products, categories, orders, and user profiles. The API documentation is generated using DRF Spectacular, making it easy to understand and use.
- User Authentication: Supports Google OAuth and JWT for secure user login.
- Product Management: Create, read, update, and delete products easily.
- Category Management: Organize products into categories for better navigation.
- Order Management: Handle customer orders efficiently.
- User Profiles: Manage user information and preferences.
- API Documentation: Automatically generated documentation for easy reference.
This project leverages a variety of technologies to provide a seamless e-commerce experience:
- Django: A high-level Python web framework that encourages rapid development.
- Django REST Framework: A powerful toolkit for building Web APIs.
- Celery: Asynchronous task queue/job queue based on distributed message passing.
- Redis: In-memory data structure store used as a database, cache, and message broker.
- Django Allauth: Integrated set of Django applications addressing authentication, registration, account management, and more.
- Simple JWT: JSON Web Token authentication for Django REST Framework.
- SQL: Structured Query Language for managing and querying relational databases.
To get started with the Django E-commerce App, follow these steps:
-
Clone the Repository:
git clone https://github.com/JobValdez/django-ecommerce-app.git cd django-ecommerce-app
-
Create a Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Requirements:
pip install -r requirements.txt
-
Set Up Environment Variables: Create a
.env
file in the root directory and add your environment variables, such as database credentials and secret keys. -
Run Migrations:
python manage.py migrate
-
Start the Development Server:
python manage.py runserver
Your API should now be running at http://127.0.0.1:8000/
.
Once your server is up and running, you can interact with the API using tools like Postman or curl. Below are some examples of how to use the endpoints.
To authenticate users, you can use the Google OAuth flow or JWT tokens. After logging in, you will receive a token that you can use for subsequent requests.
-
Create a Product:
POST /api/products/ Content-Type: application/json { "name": "Product Name", "price": 29.99, "category": "Category ID", "description": "Product Description" }
-
Get All Products:
GET /api/products/
-
Create an Order:
POST /api/orders/ Content-Type: application/json { "user": "User ID", "products": [ { "product": "Product ID", "quantity": 2 } ] }
-
Get All Orders:
GET /api/orders/
For detailed API documentation, visit the Releases section. Here, you will find all the necessary information about endpoints, request formats, and response structures.
We welcome contributions to improve the Django E-commerce App. To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a pull request.
Please ensure your code adheres to the project's coding standards and is well-documented.
This project is licensed under the MIT License. See the LICENSE file for details.
For any inquiries or feedback, please reach out:
- Email: jobvaldez@example.com
- GitHub: JobValdez
Thank you for checking out the Django E-commerce App! We hope it serves as a useful resource for your projects.