| core | ||
| fixtures | ||
| inventory | ||
| staticfiles | ||
| templates | ||
| transaction | ||
| .gitignore | ||
| manage.py | ||
| README.md | ||
| requirements.txt | ||
| sample.env | ||
Inventory Management System
Overview
This project is an inventory management system (Let's call it InvtrackPRO, Thank ChatGPT for this name😂)
using the Django web framework and PostgreSQL as the relational database.
This inventory management system focuses on wholesale business where it needs to have warehouses, suppliers, and orders from customers. Anyway, this project will rely much on admin functionality, and the admin needs to manually add transactions.
For more information about design and development : Wiki Page
Installation
Here are the overview of steps to install and run this project.
- Install
Python - Install
PostgreSQLviadockerorinstaller - Create virutal environment then install requirements
- Migrate database, load fixture, and run server
Install Python and PostgreSQL
Install python
-
Download python installer and follow the guide in Python website
-
Check python installation
python --version
Install PostgreSQL via docker
-
First of all download and install docker desktop that contain docker engine, docker CLI, and etc.
-
Pull docker
postgresImage
docker pull postgres
- Create a Docker container for PostgreSQL. Adjust these variable in the command below
YOUR_CONTAINER_NAMEYOUR_POSTGRE_USERNAMEYOUR_POSTGRE_PASSWORD
docker run --name YOUR_CONTAINER_NAME -e POSTGRES_USER=YOUR_POSTGRE_USERNAME -e POSTGRES_PASSWORD=YOUR_POSTGRE_PASSWORD -p 5432:5432 -d postgres
- Wait for the container to start. You can check the logs with
docker logs YOUR_CONTAINER_NAME
Extra: you can download pgadmin4 via docker which is a tool for manage postgres database. Click here For more information
Host: localhost
Port: 5432 (or the port you specified)
Database: postgres
Database User: YOUR_POSTGRE_USERNAME
Password: YOUR_POSTGRE_PASSWORD
Install PostgreSQL via Installer
We recommend to install postgres with pgadmin4
After install postgres and pgadmin4 you must
- Create new database.
- Specify username, password and host as you desired.
Usually Host name will be localhost , port will be 5432, and default postgres database user is postgres
Setup Environment and Django
Clone this repository and Create virtual environment with venv or virtualenv.
- Clone this repository
git clone https://github.com/Sosokker/Inventory-Management-System
cd Inventory-Management-System
- Create virtual environment and use it to install require packages
python -m venv venv
(Optional: You can use venv instead)Install virtualenv via pip
python -m pip install --user virtualenv
python -m virtualenv venv
# Access virtual environment using
# Windows
.\venv\Scripts\activate
# Linux or MacOS
source venv/bin/activate
- Install require module.
pip install -r requirements.txt
Setup Django
- Create file
.envto provide environment varible for Django You can look atsample.envfor more information and others environment variables to set.
SECRET_KEY=your_secret_key
DEBUG=True # Set False on production
ALLOWED_HOSTS=localhost, 127.0.0.1, ::1
DB_NAME=YOUR_DATABASENAME # ex: postgres
DB_USER=YOUR_POSTGRE_USERNAME
DB_PASSWORD=YOUR_POSTGRE_PASSWORD
DB_HOST=YOUR_DB_HOST # ex: localhost
DB_PORT=your_DB_PORT # ex: 5432
Generate Secret key from Djecrety
Don't forget to change your_secret_key to your secret key (without quote)
- Migrate database, load fixture, and then runserver
python manage.py migrate
python manage.py loaddata fixtures/data.json
python manage.py runserver
You can now access webpage via http://127.0.0.1:8000/ or you can change port by
python manage.py runserver <PORT>
For Testing
| Username | Password |
|---|---|
| sirin | helloworld123 |
Or you can create new super user by
python manage.py createsuperuser
Resource
- startbootstrap-sb-admin-2 for UI