8000 GitHub - xkmato/stockapi
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

xkmato/stockapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Stock API

git clone https://github.com/xkmato/stockapi

cd stockapi

./manage.py test

./manage.py migrate

./manage.py runserver

Authentication

Visit https://localhost:8000/admin/ to create some users

Go to http://localhost:8000/o/application/ to create an app

Do curl -X POST -d "grant_type=password&username=<user_name>&password=<password>" -u"<client_id>:<client_secret>" http://localhost:8000/o/token/ to get an access token

To access the api go to:

curl -H "Authorization: Bearer <your_access_token>" http://localhost:8000/stocks/ #List the stocks
curl -H "Authorization: Bearer <your_access_token>" -X POST -d"name=foo&description=bar&launch_date=2019-03-02" http://localhost:8000/stocks/ #Post new stock

Checkout the tests to see how to update stock prices

Call command python manage.py update_stock <stockid> <new_price> with crontab

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0