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

from loquat.server import Server
from loquat.web import Application

from handler import BaseHandler


class IndexHandler(BaseHandler):
    def initialize(self, database):
        self.database = database

    def get(self):
        self.write("hello world!")


class TestApplication(Application):
    def __init__(self, handlers=None, middlewares=None, transforms=None):
        super().__init__(handlers, middlewares, transforms)


def main():
    handlers = [
        (r"/", IndexHandler, dict(database="this is database"))
    ]
    application = TestApplication(handlers=handlers)
    server = Server(application)
    server.start()

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.7.tar.gz (11.9 kB view hashes)

Uploaded Source

Built Distribution

loquat-0.1.7-py2.py3-none-any.whl (13.6 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