This is a simple inventory management system written in Python using Flask.
- Python 3.x
- Flask
-
Clone the repository.
-
Navigate to the project directory.
-
Create a virtual environment and activate it:
pip install virtualenv virtualenv venv
-
Windows:
venv\Scripts\activate
For Windows, if this is your first time running the script, you might get an error like below:
venv\Scripts\activate : File C:\flask_project\venv\Scripts\Activate.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:1 + venv\Scripts\activate + FullyQualifiedErrorId : UnauthorizedAccess
This means that you don’t have access to execute the scripts.
To solve this error, run PowerShell as admin. When you right-click on the PowerShell icon, choose the option ‘Run as administrator’. Now, PowerShell will open in admin mode.
Type the following command in Shell:
set-executionpolicy remotesigned
-
Linux:
source ./venv/bin/activate
-
-
Install the requirements:
pip install flask pip install db-sqlite3
-
Run the application:
flask --app main run
- Add Item:
POST /items
- View Items:
GET /items
- Update Item:
PUT /items/<id>
- Delete Item:
DELETE /items/<id>
{
"name": "Item Name",
"quantity": 10,
"price": 19.99
}