This service is for simple demoing purposes only. It is also still "under construction". With that being said, this service contains 3 models - Category, Product, and Inventory. The exposted endpoints currently support the following features:
-
Query for all categories (i.e. "electronics", "clothing", etc.).
-
Query for all products. Result is paginated, returning 10 records at a time. Furthermore, category_id query param can be used to return subset of products that belong to the requested category.
-
Query to retrieve a specific product by product id.
-
Clone this repo and cd in to dir.
-
Create conda env and activate.
-
Install project dependencies.
pip install -r requirements.txt
-
Install PostgreSQL on your machine if not already installed.
-
Create a new database and define a user that has read/write access to it.
-
Define the following system env vars:
WAREHOUSE_DB_NAME=your_db_name WAREHOUSE_DB_USER=your_db_user WAREHOUSE_DB_PASS=your_db_password
-
Run migrations.
python manage.py makemigrations python manage.py migrate
-
Load initial data into db.
python manage.py loaddata shop/fixtures/init_data.json
-
Run dev server.
python manage.py runserver
Try heading over to http://127.0.0.1:8000/shop/products/
. You should see products!