DRF Shop is an e-commerce platform built using Django and Django REST Framework (DRF). This project provides APIs for managing products, orders, and users.
- User authentication and authorization
- Product listing and detail views
- Cart management
- Order creation and tracking
- Admin panel for managing products and orders
-
Clone the repository:
git clone https://github.com/AlexTkDev/drf-shop.git cd drf-shop
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install the dependencies:
pip install -r requirements.txt
-
Run the migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Start the development server:
python manage.py runserver
- Register:
POST /api/auth/register/
- Login:
POST /api/auth/login/
- Logout:
POST /api/auth/logout/
- List products:
GET /api/products/
- Product details:
GET /api/products/<id>/
- View cart:
GET /api/cart/
- Add to cart:
POST /api/cart/add/
- Remove from cart:
POST /api/cart/remove/
- Create order:
POST /api/orders/create/
- Order details:
GET /api/orders/<id>/
To access the admin panel, go to http://127.0.0.1:8000/admin/
and log in with the superuser credentials.
Contributions are welcome! Please fork the repository and create a pull request.
This project is licensed under the MIT License.