Tangled Web

Resource oriented Web framework for Python 3 

Home

Tangled Web is a resource oriented Web framework that runs on Python 3.4+.

A Tangled Web application consists of an Application, Resources, and Representations. There are no "views", "controllers", or thread locals.

The framework and this site are both under active development (get the code here).

Example

from wsgiref.simple_server import make_server

from tangled.web import Application, Resource


class Hello(Resource):

    def GET(self):
        if 'name' in self.urlvars:
            content = 'Hello, {name}'.format(**self.urlvars)
        else:
            content = 'Hello'
        return content


if __name__ == '__main__':
    settings = {
        'debug': True,
    }
    app = Application(settings)
    app.mount_resource('hello', Hello, '/')
    app.mount_resource('hello_name', Hello, '/<name>')
    server = make_server('0.0.0.0', 6666, app)
    server.serve_forever()

Source Code

https://github.com/TangledWeb

Documentation

Main documentation
All documentation

Published: N/A