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 3.12 or later — Download Python
- Git — Download Git
- pip — Usually comes with Python
- A terminal/command prompt
python --version # Should show Python 3.12+
git --version # Should show git version
pip --version # Should show pip versiongit clone https://github.com/Ndevu12/the_inventory.git
cd the_inventoryA virtual environment isolates project dependencies from your system Python.
On macOS/Linux:
python -m venv venv
source venv/bin/activateOn Windows:
python -m venv venv
venv\Scripts\activateYou should see (venv) in your terminal prompt when activated.
pip install -r requirements.txtThis installs Django, Wagtail, Django REST Framework, and all other required packages.
cd srcAll Django commands must be run from this directory.
python manage.py migrateThis creates the SQLite database and sets up all tables.
python manage.py createsuperuserFollow the prompts to create your admin account:
- Username: (choose a username)
- Email: (your email)
- Password: (choose a strong password)
To populate the database with sample data for testing:
python manage.py seed_database --clear --create-defaultThis creates:
- A default tenant organization
- Sample products, categories, and stock locations
- Sample users and test data
python manage.py runserverYou 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:
- Wagtail Admin: http://localhost:8000/admin/
- API Root: http://localhost:8000/api/v1/
- API Documentation: http://localhost:8000/api/schema/swagger/
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.
- Read the API Documentation for comprehensive endpoint reference
- Check Integration Guide if you're building a frontend
- See Deployment Guide for production setup
- Check Environment Variables for configuration options
- Read Development Guide to set up for contributing
- See Contributing Guide for workflow
- See Operations Guide for platform management
- Check Troubleshooting Guide for common issues
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 8001Error: No such table
Solution: Run migrations again:
python manage.py migrateError: Permission denied
Solution: Make sure your virtual environment is activated:
source venv/bin/activateSee the Troubleshooting Guide for more help.
- Explore the API: Visit http://localhost:8000/api/schema/swagger/ to browse all endpoints
- Read the Docs: Check out the API Documentation
- Integrate a Frontend: See Integration Guide
- Deploy to Production: Follow Deployment Guide
- 📖 Check the FAQ
- 🐛 See Troubleshooting Guide
- 💬 Open an Issue on GitHub
- 📚 Read the Architecture Guide for technical details
Happy coding! 🚀