Home

Published: Fri, Jan 24, 2014 at 3:51pm

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

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

The framework and this site are both under active development.

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

It's on GitHub

Documentation

Main documentation

Documentation for all tangled.* packages