My Contacts App: My Contacts
git clone https://github.com/cardosorrenan/my_contacts_api
cd ./my_contacts_api
pip install -r requirements.txt
python manage.py migrate
python manage.py loaddata my_contacts/fixtures/*.json
./manage.py createsuperuser2 --username renan --password 1234 --noinput --email 'renan@teste.com'
python manage.py runserver
Insomnia File - Download and import 🚀
Person {
id: number
name: string
favorite: boolean
phones: Phone[]
created_at: date
updated_at: date
}
URL | METHOD | REQUEST BODY | RESPONSE | |
---|---|---|---|---|
INDEX | /contacts/persons | GET | - | Person[ ] |
GET ONE | /contacts/persons/{id} | GET | - | Person |
SAVE | /contacts/persons | POST | name, favorite |
Person |
EDIT | /contacts/persons/{id} | PATCH | name, favorite |
Person |
DELETE | /contacts/persons/{id} | DELETE | - | - |
Phone {
id: number
number: string
person: number
created_at: date
updated_at: date
}
URL | METHOD | REQUEST BODY | RESPONSE | |
---|---|---|---|---|
INDEX | /contacts/phones | GET | - | Phone[ ] |
GET ONE | /contacts/phones/{id} | GET | - | Phone |
SAVE | /contacts/phones | POST | number, person |
Phone |
EDIT | /contacts/phones/{id} | PATCH | number, person |
Phone |
DELETE | /contacts/phones/{id} | DELETE | - | - |