https://github.com/wsanchez/sample-klein-app
Sample Twisted Klein Application
https://github.com/wsanchez/sample-klein-app
klein twisted
Last synced: 4 months ago
JSON representation
Sample Twisted Klein Application
- Host: GitHub
- URL: https://github.com/wsanchez/sample-klein-app
- Owner: wsanchez
- Created: 2016-11-02T21:28:50.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-02T00:09:17.000Z (about 9 years ago)
- Last Synced: 2025-08-17T13:29:54.353Z (10 months ago)
- Topics: klein, twisted
- Language: Python
- Size: 127 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
Sample Klein App
================
.. image:: https://api.travis-ci.org/wsanchez/sample-klein-app.svg?branch=master
:target: https://travis-ci.org/wsanchez/sample-klein-app
:alt: Build Status
.. image:: https://codecov.io/github/wsanchez/sample-klein-app/coverage.svg?branch=master
:target: https://codecov.io/github/wsanchez/sample-klein-app?branch=master
:alt: Code Coverage
.. image:: https://requires.io/github/wsanchez/sample-klein-app/requirements.svg?branch=master
:target: https://requires.io/github/wsanchez/sample-klein-app/requirements/?branch=master
:alt: Requirements Status
A sample application in Python, using the Klein_ web framework.
Klein is a lightweight web framework, similar to Flask_ or Bottle_.
The primary differentiator for Klein is that it is built on the Twisted_
framework, which enables one to write *asynchronous* applications.
This sample application attempts to demonstrate a few things:
* Basic usage of Klein.
See hello.py_.
* Using URL path components as arguments.
See math.py_.
* Use of ``handle_errors`` to catch exceptions and respond with an
appropriate error.
See math.py_.
* Composition of Klein applications.
See composite.py_.
* Using Twisted to write asynchronous code using ``async``/``await``.
See dns.py_.
.. ------------------------------------------------------------------------- ..
.. _composite.py: src/sample_klein_app/application/composite.py
.. _dns.py: src/sample_klein_app/application/dns.py
.. _hello.py: src/sample_klein_app/application/hello.py
.. _math.py: src/sample_klein_app/application/math.py
.. _Bottle: http://bottlepy.org/
.. _Flask: http://flask.pocoo.org/
.. _Klein: https://github.com/twisted/klein/
.. _Twisted: http://twistedmatrix.com/