In this example, the CherryPy-based REST API server uses SQLAlchemy as the ORM with a backing SQLite database for the backend.
The "entry point" for this example is server.py
. Create a virtualenv
and run server.py
to launch the REST API server. By default, it listens only on localhost
on port 8080
.
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
python3 server.py
The SQLite3 database is named mydb.sqlite
. It is automatically created in current directory (wherever server.py
is executed).
Marshmallow is used to serialize the SQLAlchemy results objects and deserialize the POST data on the create requests.