ToscaWidgets can be installed using easy_install from setuptools.
To install the latest stable release type in a shell:
$ easy_install ToscaWidgets
To install the latest development snapshot request the dev version:
$ easy_install ToscaWidgets==dev
To use ToscaWidgets needs to interface the framework in which the widgets will be used in to serve static resources, inject CSS & JS links and to initialize a per-request storage area. Pre 0.3 versions of ToscaWidgets were pretty bolier-platey to integrate but since then the interface has been greatly simplified to only require two lines of code in most situations.
Integration into a WSGI app only requires to stack ToscaWidget’s tw.core.middleware:
from tw.api import make_middleware
def application(environ, start_response):
# Your WSGI application
.....
application = make_middleware(application, {
'toscawidgets.framework.default_view': 'mako',
'toscawidgets.middleware.inject_resources': True,
})
Now this wrapped app can be fed to any WSGI compliant server. XXX: Explain config dict sent to make_middleware
There’s a full example in WSGI app example
To display Tosca widgets on a Turbogears 1.X app enable ToscaWidgets extension in yourapp/config/app.cfg by adding the following line:
toscawidgets.on = True
There’s a full example in TurboGears 1.x app example
ToscaWidgets already comes pre-configured when you quickstart a TG2 app.
Since CherryPy 3 can use WSGI middleware integration only differs in CherryPy’s API to pipeline several middleware pieces.
There’s a full example in CherryPy 3 app example
Pylons is fully WSGI compliant inside out. See Integration into a WSGI app.
Web.py can use WSGI middleware so the same method can be used as for the rest of the WSGI frameworks, only using web.py’s API. There’s a full example at web.py app example.