Skip to Content
Building Web Applications with Flask
book

Building Web Applications with Flask

by Italo Maia
June 2015
Intermediate to advanced
160 pages
3h 22m
English
Packt Publishing
Content preview from Building Web Applications with Flask

Flask-Restless

Flask-Restless is an extension capable of auto-generating a whole RESTful API for your SQLAlchemy models with support for GET, POST, PUT, and DELETE. Most Web services won't need more than that. Another advantage to using Flask-Restless is the chance to extend the auto-generated methods with authentication validation, custom behavior, and custom queries. This is a must-learn extension!

Let's see how our Web service would look with Flask-Restless. We'll also have to install a new library for this example:

pip install Flask-Restless

And then:

# coding:utf-8 from flask import Flask, url_for from flask.ext.restless import APIManager from flask.ext.sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['SECRET_KEY'] = 'secret' app.config['SQLALCHEMY_DATABASE_URI'] ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building RESTful Python Web Services

Building RESTful Python Web Services

Gastón C. Hillar

Publisher Resources

ISBN: 9781784396152Supplemental Content