John Lindquist
Building RESTful APIs with Flask in PyCharm
Quickly make your API accessible in just a few lines of code.
Building APIs can be easier than you think. Say you’ve developed a product or service and would like to provide developer access via a RESTful API quickly, with minimal effort and overhead. The lightweight Flask Python Web framework lets you easily build extendible APIs fast, without the bloat and ceremony of similar tools. Add to this the comprehensive workflow of a modern integrated development environment like PyCharm and you’ll be up and running posthaste.
We’ll start with installing a few prerequisites and set up our working environment so that testing, debugging, and extending the API can happen without too much hopping around. Afterward, we’ll move on to connecting to our database with SQLAlchemy, a Python SQL toolkit and object-relational mapper. We’ll finish up by creating the RESTful API with Flask-Restless, a Flask extension that provides the simple generation of RESTful JSON APIs for database models defined by SQLAlchemy.