/flask-rest-api-tuto

A little tutorial on creating REST api with Flask (python3)

Primary LanguageHTMLApache License 2.0Apache-2.0

Flask REST Api with Python 3

=> tuto slides: http://bit.ly/flask-rest-api-tuto <=

Kezako

This is a little Flask App showing [my] good practices for creating REST apis with Flask.

It presents two main methods:

  • using basic Flask (and Flask-wtf),
  • using Flask-RESTful

More importantly, it shows how to:

  • structure an app
  • test an app
  • use setuptools to package an app

Setup

git clone git@github.com:derlin/flask-rest-api-tuto.git
cd flask-rest-api-tuto
python setup.py install

Run

From the terminal:

python -m llapp run

Using docker (will be available on http://localhost:80):

docker build --rm -t llapp .
docker run --rm -d --name llapp -p 80:80 llapp

Using gunicorn:

pip install gunicorn
gunicorn "llapp:create_app()"