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.handlers.base import BaseHandler
from loquat.server import Server
from loquat.web import Application
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.4.tar.gz
(10.8 kB
view hashes)
Built Distribution
loquat-0.1.4-py2.py3-none-any.whl
(12.3 kB
view hashes)
Close
Hashes for loquat-0.1.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9fdd6b66d85985bf23272d35ae4c324077cfac0b4dfec3217fd50f232195b79 |
|
MD5 | 1dc8103032c05baf7c4d372ab17fde8b |
|
BLAKE2b-256 | 73a86ba40688535217e93fe2ee5779b63f8cd5cdf040e1c4ad6b56a81821d4fa |