jsonapi.tornado

The py-jsonapi extension for tornado. Binding the API to a tornado application is as simple as:

import tornado
import tornado.web
import jsonapi
import jsonapi.tornado

app = tornado.web.Application()
api = jsonapi.tornado.TornadoAPI("/api", db=..., tornado_app=app)

# If the tornado application is not available, when you create the API,
# you can bind it later:
api.init_app(app)

The API instance is added to the tornado application’s settings dictionary:

assert app.settings["jsonapi"] is api

API

class jsonapi.tornado.TornadoAPI(uri, db, settings=None, tornado_app=None)[source]

Bases: jsonapi.asyncio.api.API

Integrates py-jsonapi into a tornado application.

debug

Proxy for the debug setting of the parent tornado application. If you want to enable the debug mode, you must do it on the tornado application.

tornado_app

Returns the tornado application, which owns this API.

init_app(app)[source]

Registers the API handler on the tornado application.

Parameters:app (tornado.web.Application) –