Was this page helpful?
Python 3
Clone the repository:
git clone https://github.com/zseta/shopping-cart
cd shopping-cart
Connect to your ScyllaDB Cloud cluster using CQLSH and create the schema:
cqlsh -u scylla -p <YOUR_PASSWORD> -f schema.cql xxxx.xxxx.xxxx.clusters.scylla.cloud
Create a new virtual environment:
virtualenv env
source env/bin/activate
Install Python requirements (FastAPI with Uvicorn server and ScyllaDB driver):
pip install fastapi "uvicorn[standard]" scylla-driver
Modify config.py
to match your database credentials:
HOST="node-0.aws-us-east-1.xxxx.clusters.scylla.cloud"
USER="scylla"
PASSWORD="xxxxxx"
DATACENTER="AWS_US_EAST_1"
KEYSPACE="ecommerce"
Run the server:
uvicorn main:app --reload
Visit API docs: http://127.0.0.1:8000/docs
Was this page helpful?