This Django project that include REST APIS for Ecommerce website i.e TEDStore.
Python Django
Install dependencies: pip install -r requirements.txt Apply database migrations: python manage.py migrate Create a superuser: python manage.py createsuperuser Run the development server: python manage.py runserver
GET /api/productResponse: Return list of all products
GET /api/offerResponse: { "offer_id": 1, "offer_category": "Discount Offer", "offer_description": "35 % discount on dell" }
POST /api/newsletter
Request Body:
{
"email": "example@example.com"
} POST /api/add_cart
Request Body:
{
user_id:int,
product_id:int,
quantity:int,
} GET /api/get_subcategories/${category_id}| Parameter | Type | Description |
|---|---|---|
category_id |
number |
Required. Id of category to fetch subcategories |
GET /api/review/${slug}| Parameter | Type | Description |
|---|---|---|
slug |
string |
Required. slug of product to fetch review details of product |
GET /api/category/${slug}| Parameter | Type | Description |
|---|---|---|
slug |
string |
Required. slug of product to fetch category of product |
POST /api/likes
Request body:
{
'review_id':1,
'user_id':1
} POST /api/dislikes
Request body:
{
'review_id':1,
'user_id':1
} GET /api/related_products/<slug>/| Parameter | Type | Description |
|---|---|---|
slug |
string |
Required. slug of product to fetch particular product |
POST /accounts/registerrequest body: { "email": "example@example.com", "phone_number": 1234567890, "address": "123 Example St, City, Country", "password": "example_password", "password2": "example_password"
}
POST /accounts/loginrequest body: { "email": "example@example.com", "password": "example_password"
}
GET /accounts/profilesend access token in header
GET /accounts/change_passwordsend access token of login user in header