Commit badfdc6c authored by freetux's avatar freetux

make reademe readable

parent 167f07dd
......@@ -14,12 +14,12 @@ An example Django REST framework project for test driven development.
allow methods:post
example:
POST:
```
curl -X POST -d "email=youremail&password=yourpassword" tanbama.ir/api/user/
```
output:
give you a token and your user data.
give you a token and your user data.
* **/api/user/api-token-auth/**
......@@ -28,22 +28,22 @@ provides JSON Web Token Authentication
allow methods:post
example:
POST:
```
curl -X POST -d "username=yourusername&password=yourpassword" tanbama.ir/api/api-token-auth/
```
output:
token: "yourtoken" and "user data"
token: "yourtoken" and "user data"
* **/api/user/api-token-refresh/**
your tokens can be "refreshed" to obtain a brand new token with renewed expiration time.
your tokens can be "refreshed" to obtain a brand new token with renewed expiration time.
allow methods:post
example:
POST:
```
curl -X POST -H "Content-Type: application/json" -d '{"token":"<EXISTING_TOKEN>"}' tanbama.ir/api/api-token-refresh/
```
#### body/weights
......@@ -53,22 +53,22 @@ curl -X POST -H "Content-Type: application/json" -d '{"token":"<EXISTING_TOKEN>"
Allowed methods:GET, POST
GET:
```
curl -H "Authorization: JWT yourtoken" -H "Content-type: application/json" -H "Accept: application/json" -X GET tanbama.ir/api/body/weights
```
output:
list of your height and weights
list of your height and weights
POST
```
curl -H "Authorization: JWT yourtoken" -H "Content-type: application/json" -H "Accept: application/json" -d '{"weight":70,"height":182,"text":"demo"}' -X POST tanbama.ir/api/body/weights
```
output:
create an weight and height to database
create an weight and height to database
* **/api/body/weights/{weight-id}/** (weight and height retrieve, update and destroy endpoint)
......@@ -81,27 +81,27 @@ create an weight and height to database
Allowed methods:GET, POST
GET:
```
curl -H "Authorization: JWT yourtoken" -H "Content-type: application/json" -H "Accept: application/json" -X GET tanbama.ir/api/body/drug
```
output:
list of drugs
list of drugs
POST:
```
curl -H "Authorization: JWT yourtoken" -H "Content-type: application/json" -H "Accept: application/json" -d '{"name":drug-name,"description":"drug-description"}' -X POST tanbama.ir/api/body/drug
```
output:
add a drug to database but just stuff users can add drug!
add a drug to database but just stuff users can add drug!
* **/api/body/drug/{drug-id}/** (drug retrieve, update and destroy endpoint)
and also just stuff users can update and destroy drug!
and also just stuff users can update and destroy drug!
......@@ -113,53 +113,56 @@ and also just stuff users can update and destroy drug!
Allowed methods:GET, POST
GET:
```
curl -H "Authorization: JWT yourtoken" -H "Content-type: application/json" -H "Accept: application/json" -X GET tanbama.ir/api/body/rx
```
output:
list of rxs for each user
list of rxs for each user
POST:
```
curl -H "Authorization: JWT yourtoken" -H "Content-type: application/json" -H "Accept: application/json" -d '{"user":user,"drugs":"drugslist"}' -X POST tanbam a.ir/api/body/rx
```
output:
add a rx to database but just stuff users can add rx!
add a rx to database but just stuff users can add rx!
* **/api/body/rx/{rx-id}/** (rx retrieve, update and destroy endpoint)
and also just stuff users can update and destroy rx!
and also just stuff users can update and destroy rx!
### Install
pip install -r requirements.txt
```
pip install -r requirements.txt
```
### Usage
how to development:
dependencies:
1.python 3
3.pip package management system
1.python 3
3.pip package management system
### Install
1.make a python3 virtualenv
```
virtualenv -p python3 tanbamaenv
2.go to virtualenv
```
2.go to virtualenv
```
source tanbamaenv/bin/activate
```
3.install requirements
```
pip install -r requirements.txt
```
now everything is ok and you can cd to ranbamaapp directory and run server
```
cd tanbamaapp
python manage.py runserver
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment