Skip to main content

A framework to simplify tornado daemon development.

Project description

https://travis-ci.org/cfhamlet/os-tornado.svg?branch=master PyPI - Python Version PyPI

A framework to organize tornado project and simplify development.

Install

pip install os-tornado

Usage

  • Create project

    os-tornado startproject new_project

    Will create a project structure:

    new_project/
    ├── app
    │   ├── extensions
    │   │   ├── example_extension.py
    │   │   ├── __init__.py
    │   ├── request_handlers
    │   │   ├── example_handler.py
    │   │   ├── __init__.py
    │   ├── __init__.py
    │   ├── settings.py
    └── manager.py
    
  • Write your extensions and request handlers

  • Configure settings (app/settings.py)

  • Run server

    python manager.py runserver

Advanced Usage

  • os_tornado.decorators.jsonify

    jsonify returned dict and raised HTTPError

    example:

    @jsonify
    class ExampleHandler(RequestHandler):
    
        def get(self, *args, **kwargs):
            return {'status':'ok'}
    
        def post(self, *args, **kwargs):
            raise HTTPHandler(405)
    

Unit Tests

$ tox

License

MIT licensed.

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
os-tornado-0.3.0.tar.gz (18.2 kB) Copy SHA256 hash SHA256 Source None Mar 21, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page