English 中文(简体)
TurboGears - Pluggable Applications
  • 时间:2024-09-17

TurboGears - Pluggable Apppcations


Previous Page Next Page  

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

Use the following gearbox command to create a pluggable apppcation −

gearbox quickstart-pluggable plugtest

These pluggable apppcations can define their own −

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

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

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

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

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

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

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