Skip to content

guanzhenxing/loquat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()

About

A simple web framework based on Tornado.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages