contacts-backend-python-bottle is part of "contacts" project that is an initiative where we try to explore frontend and backend implementations in order to better understand it cutting-edge features. This repository presents a python rest API sample.
- python 3.10
- bottle
- sqlite
- pony
- migrations
- small footprint
execute the remote docker image
docker run -p 8010:8010 wastingnotime/contacts-backend-python-bottle
build a local docker image
docker build --tag contacts-backend-python-bottle .
execute the local docker image
docker run -p 8010:8010 contacts-backend-python-bottle
- first, install python 3.10+, if you don't have it on your computer: how to install python 3
- go to root of solution and execute the commands below
set environment for development
cp .env_example .env
activate venv
source venv/bin/activate
install deps
pip install -r requirements.txt
and then run the application
python3 main.py
create a new contact
curl --request POST \
--url http://localhost:8010/contacts \
--header 'Content-Type: application/json' \
--data '{
"firstName": "Albert",
"lastName": "Einstein",
"phoneNumber": "2222-1111"
}'
retrieve existing contacts
curl --request GET \
--url http://localhost:8010/contacts
more examples and details about requests on (link) *to be defined