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

```python
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.

Source Distribution

tornado-alchemy-rest-0.1.2.tar.gz (4.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page