This diagram is not as bad as it may seem. It shows the core parts that make up a TurboGears application.
TurboGears follows the MVC (Model, View, Controller) design pattern, which separates the web application design into three different domains, which is also reflected in the structure of a default quickstarted project.
A great deal of the boilerplate code is contained in the the TurboGears package itself. Your application consists of the parts in the light purple boxes. Let’s look at each part.
The controller is the basis of the framework, and the view and the model can be created in other ways. This means that TurboGears offers you the flexibility to ‘not use the MVC design as well. Thus you can port existing web software to TurboGears without an immediate complete revision to all of the code.
So, you have these three areas to populate with code in order to build your application. TurboGears provides help at each point.
While entering the quickstart template folder, you’ll see the project skeleton laid there. Those files can be categorized for 4 purposes. Note that with TurboGears you’ll spend most of time on the files printed in bold below. We will cover all the important files that make up a fresh quickstarted project in the following sections categorized by purpose.
To Write anything you like about your project.
Packaging, distribution and installation related settings.
To start your web application
To provide application related infomation.
Auto-generated packaging meta-data from setup.py.
You an publish your project to the Python Cheeseshop in minutes by changing only a few lines in the above files.
For deployment-specific configuration settings in development mode
A template for deployment-specific configuration settings in production mode
<your project name>/config/*.cfg
For deployment-independent configuration settings of your application
You do most of configurations for your project in those files. See the configuration reference for more information.
It is possible to deploy TurboGears applications behind a separate web server or let them use a database that is not located on the same server. The same web server can be placed in front of multiple applications, which can have the same database or different databases as backends.
Write your controllers (main program) here.
Write your data model (ORM/database access) here.
Write your view (templates) here.
Alternative view for AJAX applications (optional)