TurboGears - Pluggable Applications


Advertisements


If your extension needs to expose models and controllers, you probably want to have a look at the Pluggable Applications, which are meant to create reusable Turbogears applications that can be plugged inside other applications to extend their features.

Use the following gearbox command to create a pluggable application −

gearbox quickstart-pluggable plugtest

These pluggable applications can define their own −

  • Controllers − which will be automatically mounted, when the application is purged.

  • Models − which will be available inside and outside the plugged application.

  • Helpers − which can be automatically exposed in the ‘H’ object in an application template.

  • Bootstrap − which will be executed when setup-app is called.

  • Statics − which will be available at their own private path.

Install this plugtest application and mount the same by making the following modifications in app_cfg.py.

from tgext.pluggable import plug
plug(base_config, plugtest)


Advertisements
E-Books Store