WSGI Flask Application with RESTful API

by Kirby Urner
Oregon Curriculum Network


A tiny Flask application, used in my forty hour Python course as an example.

Open Source: feel free to clone

Here's the API:

returns HTML

/elements
/elements/H
/elements/all
returns JSON

/api/elements?elem=H
/api/elements?elem=all


/glossary
/glossary/.NET
/glossary/all

/api/glossary?term=.NET
/api/glossary?term=all


/shapes
/shapes/icosa
/shapes/all


/api/shapes?shape=icosa
/api/shapes?shape=all



Edit allows updating fields using POST, however Add and Delete are only stubs. Editing requires setting a secret key in your local copy.

Remote posting of new records is partially implemented (example script), for adding to any database.

web_dev