use this examples on your .env file
POSTGRES_HOST=market-db
POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_PORT=5432
make up-all
make logs-api
make test
make bash
python manage.py createsuperuser
curl --request POST \
--url http://127.0.0.1:8000/api/token/ \
--header 'Content-Type: application/json' \
--data '{
"username": "your-username",
"password": "your-password"
}'
curl --request POST \
--url http://127.0.0.1:8000/products/ \
--header 'Authorization: Bearer <access token>>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Ração para cachorro",
"price": "50.00",
"minimum": 10,
"amount_per_package": 2,
"max_availability": 50000
}'
curl --request GET \
--url 'http://127.0.0.1:8000/products/?name=cach' \
--header 'Authorization: Bearer <access token>'
--header 'Content-Type: application/json'
curl --request POST \
--url http://127.0.0.1:8000/shopping_cart/ \
--header 'Authorization: Bearer <access token>'
--header 'Content-Type: application/json' \
--data '{
"product": 1,
"quantity": 12
}'
curl --request PATCH \
--url http://127.0.0.1:8000/shopping_cart/1/ \
--header 'Authorization: Bearer <access token>'
--header 'Content-Type: application/json' \
--data '{
"quantity": 24
}'
curl --request GET \
--url 'http://127.0.0.1:8000/shopping_cart/' \
--header 'Authorization: Bearer <access token>'
--header 'Content-Type: application/json'
curl --request DELETE \
--url http://127.0.0.1:8000/shopping_cart/1/ \
--header 'Authorization: Bearer <access token>'
--header 'Content-Type: application/json'
curl --request POST \
--url http://127.0.0.1:8000/checkout/ \
--header 'Authorization: Bearer <access token>'
--header 'Content-Type: application/json'