Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
tanbama
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
9
Issues
9
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
freetux
tanbama
Commits
badfdc6c
Commit
badfdc6c
authored
May 16, 2018
by
freetux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make reademe readable
parent
167f07dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
41 deletions
+44
-41
README.md
README.md
+44
-41
No files found.
README.md
View file @
badfdc6c
...
...
@@ -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
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment