- JWT authentication
- Custom user model with roles (admin, manager, viewer)
- Asset management with status tracking
- DRF and drf-spectacular for API schema/docs
git clone [inventory-api](https://github.com/afzalhussein/inventory-api)
cd inventory-apipython -m venv env
env\Scripts\activatepip install -r requirements.txt- Ensure PostgreSQL is running.
- Create a database named
inventory_db:
psql -U postgres
CREATE DATABASE inventory_db;
\qEdit config/settings.py for your database credentials if needed.
python manage.py makemigrations
python manage.py migratepython manage.py createsuperuserpython manage.py runserverpytestAdd the following to your requirements.txt:
Django>=5.2,<6.0
djangorestframework
drf-spectacular
djangorestframework-simplejwt
django-filter
psycopg2-binary
pytest
pytest-django
- Assets:
/api/assets/ - Authentication:
/api/token/,/api/token/refresh/ - API Docs:
/api/schema/,/api/docs/
- Make sure
django-filteris installed:
pip install django-filter - If you use pytest, ensure
pytest.inicontains:[pytest] DJANGO_SETTINGS_MODULE = config.settings
inventory-api/
├── assets/
│ ├── models.py
│ ├── urls.py
│ └── views.py
├── users/
│ ├── models.py
│ └── ...
├── config/
│ ├── settings.py
│ ├── urls.py
│ └── ...
├── tests/
│ └── test_assets.py
├── requirements.txt
└── README.md




