To run the Django project and the DB
docker-compose build
docker-compose up
To run the tests, use the following command:
python manage.py test
- Technologies Used:
- Django
- Django Rest Framework (DRF)
- PostgreSQL
- Docker
-
Core Features:
- Catalog
-
Additional Features:
- JWT Authentication using HTTP Cookies
- Pagination
-
Search Filter:
- URL:
/api/products/
- Description: Enables filtering products and product variations by name, description, and attributes and variations attributes
- . Supports searching by name, description, and attributes of products.
- URL:
-
Overview: Provide an overview of the API endpoints.
-
Obtain Token Pair (Login)
- URL:
/api/login/
- Method: POST
- Description: Obtain a JWT token pair (access and refresh tokens) for a user.
- URL:
-
Refresh Token
- URL:
/api/refresh/
- Method: POST
- Description: Refresh the access token using a valid refresh token.
- URL:
-
User Registration
- URL:
/api/register/
- Method: POST
- Description: Register a new user.
- URL:
-
User Profile
- URL:
/api/profile
- Method: GET, PUT, PATCH
- Description: Retrieve or update the user's profile information.
- URL:
-
List and Create Products
- URL:
/api/products/
- Methods: GET, POST
- Description: Retrieve a list of products or create a new product.
- URL:
-
Retrieve, Update, and Delete Product
- URL:
/api/products/{id}/
- Methods: GET, PUT, PATCH, DELETE
- Description: Retrieve, update, or delete a specific product by ID.
- URL:
- List Categories
- URL:
/api/categories/
- Method: GET
- Description: Retrieve a list of categories.
- URL:
- List Product Types
- URL:
/api/product-types/
- Method: GET
- Description: Retrieve a list of product types.
- URL:
- List Attributes
- URL:
/api/attributes/
- Method: GET
- Description: Retrieve a list of attributes.
- URL:
This section outlines the tests for the ProductViewSet
, which cover CRUD operations for managing products.
-
List Products
- URL:
/products/
- Method:
GET
- Expected Status Code:
200 OK
- URL:
-
Retrieve Product
- URL:
/products/<id>/
- Method:
GET
- Expected Status Code:
200 OK
- URL:
-
Create Product
- URL:
/products/
- Method:
POST
- Expected Status Code:
201 Created
- URL:
-
Update Product
- URL:
/products/<id>/
- Method:
PUT
- Expected Status Code:
200 OK
- URL:
-
Partial Update Product
- URL:
/products/<id>/
- Method:
PATCH
- Expected Status Code:
200 OK
- URL:
-
Delete Product
- URL:
/products/<id>/
- Method:
DELETE
- Expected Status Code:
204 No Content
- URL: