Welcome to The Inventory — an open-source REST API for inventory management built with Django and Wagtail.
This guide will help you install and run the backend API locally in about 10 minutes.
Before you start, make sure you have:
python --version # Should show Python 3.12+
git --version # Should show git version
pip --version # Should show pip version
git clone https://github.com/Ndevu12/the_inventory.git
cd the_inventory
A virtual environment isolates project dependencies from your system Python.
On macOS/Linux:
python -m venv venv
source venv/bin/activate
On Windows:
python -m venv venv
venv\Scripts\activate
You should see (venv) in your terminal prompt when activated.
pip install -r requirements.txt
This installs Django, Wagtail, Django REST Framework, and all other required packages.
cd src
All Django commands must be run from this directory.
python manage.py migrate
This creates the SQLite database and sets up all tables.
python manage.py createsuperuser
Follow the prompts to create your admin account:
To populate the database with sample data for testing:
python manage.py seed_database --clear --create-default
This creates:
python manage.py runserver
You should see output like:
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Open your browser and visit:
Use the superuser credentials you created in step 6.
Try this in your terminal:
curl http://localhost:8000/api/v1/
You should see a JSON response with available API endpoints.
Error: Python 3.12+ required
Solution: Install Python 3.12 or later from python.org
Error: Address already in use
Solution: The default port 8000 is in use. Run on a different port:
python manage.py runserver 8001
Error: No such table
Solution: Run migrations again:
python manage.py migrate
Error: Permission denied
Solution: Make sure your virtual environment is activated:
source venv/bin/activate
See the Troubleshooting Guide for more help.
Happy coding! 🚀