Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

Tornado extension to support method-based handlers

Project Description
# Tornado-Router


## Overview

Tornado-Router is small extension of [Tornado Web Framework](http://www.tornadoweb.org/en/stable/) with the intent of providing alternative way of defining URI.

Some of the key features include
* Method-defined handlers
* Asynchronous authentication
* REST JSON API

[Here is blog article explaining how.](https://sickyoon.com/2016/how-to-use-function-based-router-for-tornado-url-dispatcher/)

## Usage

Check out the [Hello World Authentication demo](https://github.com/shicky/Tornado-Router/blob/master/demo/run.py) for a quick example.

```python
import base64, uuid
import tornado.web
import tornado.httpserver
import tornado.ioloop
from tornado_router import router

@router.route(url=r'/', method='get')
def index(handler):
handler.write('Hello World')

settings = {'xsrf_cookies':True, 'cookie_secret': base64.b64encode(uuid.uuid4().bytes + uuid.uuid4().bytes)}
router.init()
[m() for m in router.requests]
app = tornado.web.Application(router.handlers, **settings)
serv = tornado.httpserver.HTTPServer(app)
serv.listen(9000)
tornado.ioloop.IOLoop.current().start()
```

## Installation

```bash
git clone https://github.com/shicky/tornado-router.git
cd tornado-router
python setup.py install
```

```bash
pip install tornado-router
```

## Contributing

Please open an issue if you have any requests.
Pull requests are always welcome.

## License

This project is licensed under the MIT License.
Release History

Release History

This version
History Node

0.2.0

History Node

0.1.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
tornado_router-0.2.0.tar.gz (4.2 kB) Copy SHA256 Checksum SHA256 Source Feb 15, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting