/sales-drf-api

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

===> SALES-DRF-API PROJECT <===

Installation

Before installation make sure you have installed python 3.9 or above version in your system

Clone the project and run the following command in cmd

git clone https://github.com/AbuBakkar32/sales-drf-api.git

After that go to the project directory and run the following command in cmd

pip install -r requirements.txt

Usage the following command in cmd to run the project

python manage.py makemigrations
python manage.py migrate
python manage.py runserver

API Endpoints for Registration and Login

Registration

POST http://127.0.0.1:8000/api/auth/v1/register/

Login

POST http://127.0.0.1:8000/api/auth/v1/login/

Test Case for Registration and Login

Test case will be found inside the test.py file

python manage.py test

For import the data from csv file to database (Sqlite3). I have to download sqlite3.exe file from https://www.sqlite.org/download.html and then run the following command in cmd

sqlite3 db.sqlite3
.mode csv
.import data.csv tasktwo_salesModel

Now check your database. You will see the data is imported successfully.


API Endpoints for "data insertion and manipulation" of sales model for app tasktwo

Insertion and get list of data

POST http://127.0.0.1:8000/api/sales/v1/sales

Update, Delete and get single data

PUT http://127.0.0.1:8000/api/sales/v1/sales/1
DELETE http://127.0.0.1:8000/api/sales/v1/sales/1
GET http://127.0.0.1:8000/api/sales/v1/sales/1

Generate PDF file API

GET http://127.0.0.1:8000/api/sales/v1/report/

Generate CSV file API (Additional Feature Used)

GET http://127.0.0.1:8000/api/sales/v1/csv/

Generate PDF file will be found inside project folder

salesproject/report.pdf

Click on PDF Report to see the report


Last Two question's answer pie chart and line chart attach below using the Given data

sales_performance_pie_chart.png sales_performance_line_chart.png

Contact me

  1. Linkedin
  2. Github
  3. Facebook