Changeset 5288

Show
Ignore:
Timestamp:
08/28/08 09:40:18 (4 months ago)
Author:
mramm
Message:

TG2 quickstart template docstring added.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • projects/tg.devtools/trunk/devtools/templates/__init__.py

    r4479 r5288  
     1""" 
     2Place to hold TurboGears built-in templates 
     3 
     4With 'paster quickstart' or 'paster create' command you can create a new 
     5TurboGears project which you can use as a basis for your own project. 
     6Let's take the command 'paster quickstart helloworld' for example. 
     7The generated directory structure is as follows:: 
     8 
     9    - helloworld/ 
     10        - helloworld/ 
     11        - development.ini 
     12        - setup.cfg 
     13        - setup.py 
     14        - test.ini 
     15 
     16 
     17The setup.py file is used to create a re-distributable Python 
     18package of your project called an egg. Eggs can be thought of as 
     19similar to .jar files in Java. 
     20The setup.cfg file contains extra information about your project. 
     21 
     22The sub 'helloworld' directory within the root 'helloworld' directory 
     23is where all your application specific code and files are placed. 
     24The sub directory looks like this:: 
     25 
     26    - helloworld/ 
     27        - config/ 
     28        - controllers/ 
     29        - lib/ 
     30        - model/ 
     31        - public/ 
     32        - templates/ 
     33        - tests/ 
     34        - __init__.py 
     35        - websetup.py 
     36 
     37The config directory contains the configuration options for your web application. 
     38 
     39The controllers directory is where your application controllers are written. 
     40Controllers are the core of your application where the decision is made on what 
     41data to load, and how to view it. 
     42 
     43The lib directory is where you can put code that is used between different 
     44controllers, third party code, or any other code that doesn't fit in well elsewhere. 
     45 
     46The models directory is for your model objects, if you're using an ORM this is 
     47where the classes for them should go. 
     48Objects defined in models/__init__.py will be loaded and present as model. 
     49YourObject inside your controllers. The database configuration string can be set 
     50in your development.ini file. 
     51 
     52The public directory is where you put all your HTML, images, Javascript, CSS and 
     53other static files. It is similar to the htdocs directory in Apache. 
     54 
     55The templates directory is where templates are stored. Templates contain a mixture of 
     56plain text and Python code and are used for creating HTML and other documents in a way 
     57that is easy for designers to tweak without them needing to see all the code that 
     58goes on behind the scenes. 
     59 
     60TurboGears 2 uses Genshi templates by default but also supports Mako, and jinja 
     61out of the box.  Cheetah, Kid and any other template system you want can be  
     62easily used by writing a simple render function for them.  
     63 
     64The tests directory is where you can put controller and other tests. The controller 
     65testing functionality uses Nose and paste.fixture. 
     66 
     67The __init__.py file is present so that the helloworld directory can be used as a Python 
     68module within the egg. 
     69 
     70The websetup.py should contain any code that should be executed when an end user of your 
     71application runs the paster setup-app command described in Application Setup. 
     72If you're looking for where to put that should be run before your application is, 
     73this is the place. 
     74 
     75"""