forked from kd123/ApiInPhythonDjango
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReadme
More file actions
30 lines (22 loc) · 910 Bytes
/
Readme
File metadata and controls
30 lines (22 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
run the project by command : python manage.py runserver
on the browser or RESTClient type the url: http://127.0.0.1:8000/products/
its return all the product details in JSON format
To get the Product Details by product id
type url: http://127.0.0.1:8000/products/product_id i.e products/2
To post the data through POST method
put JSON data in content AND Media type is application/json
then click post button
If post the data through restClient then
put json data in body,
set headers as "Content-Type:application/json"
and select Method as POST then send the request
Now to check the data through command line:
Then quit the server
to get product details by id:
type in command prompt "python manage.py getproduct product_id"
i.e python manage.py getproduct 3
to get all product:
type in command Promt "python manage.py allproduct"
admin credential :
user name: kuldeep
password: admin