This Project includes developement of backend with RESTfull services for an E commerce website Spareware.com, Where users can login as a buyer or a seller and the whole Login process is secured with token based authentication system. Sellers can post their products and Buyers can place orders.
$ git clone https://github.com/Vivek1258/Django-Ecommerce-website-backend.git
( using python virtualenv )
$ virtualenv env
$ cd Django-Ecommerce-website-backend
$ pip install -r requirements.txt
$ python manage.py runserver
The URL
http://127.0.0.1:8000/users/api/register_buyer/
Example JSON body :
Here username, email, and password are only required fields other information can be updated in the buyer profile
{
"username" : "Buyer1258" ,
"email" : "[email protected]",
"password" : "Buyer@1258",
"first_name" : "Bye" ,
"last_name" : "yar",
"mobile_number" : 1000000000 ,
"img_link" : "https://sample.com" ,
"lane_no" : "3" ,
"landmark" : "Easy Death Hospital",
"village" : "sample village",
"district" : "sample district",
"state" : "sample state",
"pro_user" : false
}
The URL
http://127.0.0.1:8000/users/api/buyer-profile/
Header should contain Authorization key with value as Token :
"Authorization" : "Token ###############################################"
The URL
http://127.0.0.1:8000/users/api/update-buyer-profile/
Header should contain Authorization key with value as Token :
"Authorization" : "Token ###############################################"
JSON Body :
{
"mobile_number" : 1000000000 ,
"img_link" : "https://sample.com" ,
"lane_no" : "3" ,
"landmark" : "Easy Death Hospital",
"village" : "sample village",
"district" : "sample district",
"state" : "sample state"
}
The URL
http://127.0.0.1:8000/users/api/place_order/
Header should contain Authorization key with value as Token :
"Authorization" : "Token ###############################################"
JSON Body :
{
"order_sat" : "Placed",
"item_id" : 1
}
The URL
http://127.0.0.1:8000/users/api/get_orders/
Header should contain Authorization key with value as Token :
"Authorization" : "Token ###############################################"
The URL
http://127.0.0.1:8000/users/api/register_seller/
Example JSON body :
Here, All the information are required fields sinse we are registering a seller
{
"username" : "Seller1258" ,
"first_name" : "Sel" ,
"last_name" : "ler",
"email" : "[email protected]",
"password" : "Seller@1258",
"mobile_number" : 1000000000 ,
"img_link" : "https://sample.com" ,
"lane_no" : "3" ,
"landmark" : "Easy Death Hospital",
"village" : "sample village",
"district" : "sample district",
"state" : "sample state",
"shop_type": "Electronics Goods",
"official_doc_link" : "https://sample.com"
}
The URL
http://127.0.0.1:8000/users/api/seller-profile/
Header should contain Authorization key with value as Token :
"Authorization" : "Token ###############################################"
The URL
http://127.0.0.1:8000/users/api/update-seller-profile/
Header should contain Authorization key with value as Token :
"Authorization" : "Token ###############################################"
JSON Body :
{
"mobile_number" : 1000000000 ,
"img_link" : "https://sample.com" ,
"lane_no" : "3" ,
"landmark" : "Easy Death Hospital",
"village" : "sample village",
"district" : "sample district",
"state" : "sample state",
"shop_type": "Electronics Goods",
"official_doc_link" : "https://sample.com"
}
The URL
http://127.0.0.1:8000/users/api/add_product/
Header should contain Authorization key with value as Token :
"Authorization" : "Token ###############################################"
JSON Body :
{
"item_name": "When I met your Mother",
"item_type": "Book",
"item_sub_type": "Story",
"seller": "Raj Sellers",
"seller_email" : "[email protected]",
"seller_mobile" : 12345678910 ,
"rating" : 2 ,
"availability": true,
"stock" : 20 ,
"price": 540,
"image_link": "https://www.sampleurl.com",
"description": "some text",
"specifiation": "some text"
}
The URL
http://127.0.0.1:8000/users/api/get_products/
Header should contain Authorization key with value as Token :
"Authorization" : "Token ###############################################"
The URL
http://127.0.0.1:8000/users/api/login/
Example JSON body :
{
"username" : "Seller1258" ,
"password" : "Seller@1258"
}
The URL
http://127.0.0.1:8000/users/api/login/
Header should contain Authorization key with value as Token :
"Authorization" : "Token ###############################################"
Example JSON body :
{
"old_password" : "Seller1258" ,
"new_password" : "Seller@1258"
}
The URL
http://127.0.0.1:8000/users/api/logout/
Header should contain Authorization key with value as Token :
"Authorization" : "Token ###############################################"
Python
Django ( For Backend )
Django Rest Framework ( for RESTfull services )
Django Rest Knox ( For User Authentication )
In the case of a bug report, bugfix or suggestions, please feel free to open an issue.
Pull requests are always welcome, and we will do our best to do reviews as fast as we can.
This project is licensed under the Apache License
- If appropriate, open an issue on GitHub
- Contact me on LinkedIn
- Email [email protected]