How to create a REST API in Python using the Flask Microframework

John Kagga
Sep 16, 2017 · 6 min read
IMAGE CREDIT: Edmond Atto

The initial folder structure

api/
   |- app
      |- auth
      |- bucket
      |- bucketitems
      |- __init__.py
      |- config.py
      |- models.py
      |- views.py
  |- .gitignore
  |- manage.py
  |- run.py
  |- requirements.txt
  |- README.md

Test Driven Development


Token Based Authentication


Version Control


Data Persistence


Configuration


Continuous Integration


Adding Badges to your repository


API Documentation


Final folder structure

api/
   |- app
      |- auth
      |- bucket
      |- bucketitems
      |- docs
         |- static
            |- js
               |- apairy.js
            |- favicon
         |- templates
            |- docs
              |- index.html
      |- __init__.py
      |- config.py
      |- models.py
      |- views.py
  |- migrations
  |- tests
  |- .coveralls.yml
  |- .travis.yml
  |- run.py
  |- Procfile
  |- .gitignore
  |- manage.py
  |- requirements.txt
  |- README.md

Hosting

The Andela Way

A pool of thoughts from the brilliant people at Andela

John Kagga

Written by

Andela |The Andela Way Editor | Arvana |Facebook Dev Circles| Long-life Learner

The Andela Way

A pool of thoughts from the brilliant people at Andela