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

Uploaded Source

Built Distribution

loquat-0.1.7-py2.py3-none-any.whl (13.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file loquat-0.1.7.tar.gz.

File metadata

  • Download URL: loquat-0.1.7.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for loquat-0.1.7.tar.gz
Algorithm Hash digest
SHA256 1be3ebbc30e2109fd6b9ffeb6c129f3e83880eca16f58960bfdb39f80da7fc47
MD5 6ee778bbc90befd4361cdd26c74fa382
BLAKE2b-256 355268cd15a2f03042d49b120e6da116a46127d6784d5b48a7db5ef34ebfbfe8

See more details on using hashes here.

File details

Details for the file loquat-0.1.7-py2.py3-none-any.whl.

File metadata

  • Download URL: loquat-0.1.7-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for loquat-0.1.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a1c7ad922ea562b28f32959532add374d6b6faf3f1be08107eea32d967f02f3d
MD5 14b1f5439097bb9ac4a690ea5d436d24
BLAKE2b-256 61b876ba13a96704bf121dc6f8958f4e19f8d53f86a43e939cf147dd3d6e5ec0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page