Skip to main content

Tornado REST API

Project description

##Tornado + Alchemy REST Client

This simple module creates CRUD endpoints for some SQLAlchemy model.

####Usage example

import tornado.web
from tornado.web import URLSpec
from .models import ItemTable
from tornado_alchemy_rest import SingleRESTAPIHandler, ListRESTAPIHandler

class SingleItemHandler(SingleRESTAPIHandler):
table = ItemTable

def delete(self, *args, **kwargs):
raise HTTPError(405)

class ItemHandler(ListRESTAPIHandler):
table = ItemTable

app = tornado.web.Application([
URLSpec(prefix(r'items'), ItemHandler, dict(psql=psql_pool), 'items'),
URLSpec(prefix(r'items/(\d+)'), SingleItemHandler, dict(psql=psql_pool), 'single_item'),

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tornado-alchemy-rest, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size tornado-alchemy-rest-0.1.2.tar.gz (4.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page