Skip to main content

A simple web framework based on Tornado.

Project description

Loquat

A simple web framework based on Tornado.

Introduce

Loquat is a web framework based on Tornado.

Installation

pip install loquat

Simple uses

import loquat
from loquat import web
from loquat.handlers.base import BaseHandler
from loquat.utils import utils

class IndexHandler(BaseHandler):
    def get(self):
        self.render('index.html')

def _init_handlers():
    return [
        (r"/", IndexHandler)
    ]

def _init_app_settings():
    return {
        'debug': True
    }

def main():
    handlers = _init_handlers()
    app_settings = _init_app_settings()
    app_config = web.AppConfig(handlers=handlers, app_settings=app_settings, port=8080, env='DEV', app_name='untitled')
    web.run(app_config=app_config)

if __name__ == "__main__":
    main()

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

loquat-0.1.1.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

loquat-0.1.1-py2.py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 2 Python 3

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