Skip to content

medoedoff/restapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Rest API

To get started download the project git clone https://github.com/medoedoff/restapi.git
After go to the project directory cd directory/where/project/downloaded/restapi-master
Install requirement packages for work (you shoud have python3 and pip) pip install requirements.txt

Run django server nohup python3 manage.py runserver &

GET

curl localhost:8000/library/ -All books in Library
curl localhost:8000/library/1/ -Detail book in Library

POST (only for authenticated users)

curl -u satori:satori -d author=TestAuthor localhost:8000/library/

PUT (only for authenticated users)

curl -u satori:satori -X PUT -d author=TestUserChanged http://localhost:8000/library/4/

DELETE (only for authenticated users)

curl -u satori:satori -X DELETE localhost:8000/library/4/

Notice

You have only 10 requests per 1 minute, to change it, go to djapi/settings.py file, on line 121 find DEFAULT_THROTTLE_RATES, below you will see 'anon':10/m and user:10/m. Anon - not authenticated, User - authenticated. 10 - means how much request anon or user will have, m - means per minute. You can change it how it will comfortable for you.

P.S Sorry for my English :)

About

Django rest api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages