In the previous recipe, Creating a class-based REST interface, we saw how to create a REST interface using pluggable views. In this recipe, we will use an extension called Flask-Restful, which is written over the same pluggable views we used in the previous recipe, but which handles a lot of nuances by itself to allow us developers to focus on actual API development. It is also independent of object-relational mapping (ORM), so there are no strings attached to the ORM we may want to use.
Creating an extension-based REST interface
Getting ready
First, we will begin with the installation of the extension:
$ pip3 install Flask-Restful
We will modify the catalog application from the last recipe to add a REST interface using...