Skip to content

Flask-Examples/Tutorial-REST-API-flask-sqlalchemy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tutorial-REST-API-flask-sqlalchemy

Tutorial from 'REST API With Flask & SQL Alchemy' (Traversy Media) with some modifications by Marcus Mariano


Introduction

Make a REST API with Flask and SQLAlchemy

  • flask
  • flask-sqlalchemy
  • flask-marshmallow
  • marshmallow-sqlalchemy

Installation

pipenv install

How to Run

Create db

on Ipython

from app.model import db
from app import create_app

db.create_all(app=create_app())

On Postman

Add product

POST
http://127.0.0.1:5000/api/v1.0/product

{
	"name": "Product 1",
	"description": "This is product one",
	"price": 350.00,
	"qty": 100
}

Show products

GET
http://127.0.0.1:5000/api/v1.0/product

Show single product

GET
http://127.0.0.1:5000/api/v1.0/product/1

Update product

PUT
http://127.0.0.1:5000/api/v1.0/product/2

{
	"name": "Product 2",
	"description": "This is product 2",
	"price": 250.00,
	"qty": 20
}

Delete product

DELETE
http://127.0.0.1:5000/api/v1.0/product/2

License

Code and documentation are available according to the GNU GENERAL PUBLIC LICENSE Version 3 (see LICENSE).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages