Example of CRUD in Django with REST FRAMEWORK
Go to file
Andros Fenollosa aeb5199bdc Add fake data
2021-07-14 16:46:34 +02:00
app/library Add fake data 2021-07-14 16:46:34 +02:00
proyect Add fake data 2021-07-14 16:46:34 +02:00
scripts Add fake data 2021-07-14 16:46:34 +02:00
tests Add fake data 2021-07-14 16:46:34 +02:00
.gitignore First commit 2021-07-05 15:56:53 +02:00
manage.py Translate english 2021-07-14 16:19:03 +02:00
pytest.ini Translate english 2021-07-14 16:19:03 +02:00
README.md Add fake data 2021-07-14 16:46:34 +02:00
requirements.txt Add fake data 2021-07-14 16:46:34 +02:00

Example of CRUD in Django with REST FRAMEWORK

All endpoints contain your test.

Endpoints

  • /api/books GET
  • /api/books POST
  • /api/books/:pk GET
  • /api/books/:pk DELETE
  • /api/books/:pk PUT

Install

python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
python3 manage.py migrate

Run

python3 manage.py runserver

Fake data

python3 manage.py runscript create_books

Test

pytest