API for list items from SQLite Database using Django 4.2.13
Steps to run it locally:
- Install Python 3.11
- Install "virtualenv":
pip install virtualenv - Create virtual environment:
virtualenv -p python3 venv - Apply virtual environment:
source venv/bin/activate - Install dependencies:
pip install -r requirements.txt - Run SQL migrations:
python3 manage.py migrate - Add sample data to database:
python3 manage.py load_items - Run server:
python manage.py runserver 0.0.0.0:8000 - Test API with
curl http://127.0.0.1:8000/api/items
Steps to run it in Docker:
- Run
docker run -p 8000:8000 -d $(docker build -q .) - Test API with `curl http://127.0.0.1:8000/api/items