Skip to content

rainware/django-chilies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-chilies

to make django more delicious

Install

pip install django-chilies

Example

Download examples

git clone https://github.com/rainware/django-chilies.git
cd django-chilies/examples

1. setup db

python manage.py migrate

2. start server

python manage.py runserver 0.0.0.0:8000

3. test

curl --location --request GET '127.0.0.1:8000/bookstore/test'
curl --location --request GET '127.0.0.1:8000/bookstore/test?a=1'

4. bookstore

  • create author
curl --location --request POST '127.0.0.1:8000/bookstore/authors' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "zhangsan"
}'
curl --location --request POST '127.0.0.1:8000/bookstore/authors' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "lisi",
    "age": 30
}'
  • list authors
curl --location --request GET '127.0.0.1:8000/bookstore/authors'
  • get author detail
curl --location --request GET '127.0.0.1:8000/bookstore/authors/1'
  • modify author
curl --location --request PUT '127.0.0.1:8000/bookstore/authors/1' \
--header 'Content-Type: application/json' \
--data-raw '{
    "age": 28
}'
  • delete author
curl --location --request DELETE '127.0.0.1:8000/bookstore/authors/2'
  • create book
curl --location --request POST '127.0.0.1:8000/bookstore/books' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "time",
    "author_id": 1
}'
  • list books
curl --location --request GET '127.0.0.1:8000/bookstore/books'
  • get book detail
curl --location --request GET '127.0.0.1:8000/bookstore/books/1'
  • modify book
curl --location --request PATCH '127.0.0.1:8000/bookstore/books/1' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "bookk"
}'
  • delete book
curl --location --request DELETE '127.0.0.1:8000/bookstore/books/1'

About

to make django more delicious

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages