Changeset 4575

Show
Ignore:
Timestamp:
05/13/08 10:36:37 (2 months ago)
Author:
carndt
Message:

Fix webhelpers mercurial URL in INSTALL.txt

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/docs/2.0/BasicMoves.rst

    r4556 r4575  
     1 
     2 
     3 
     4 
    15TurboGears 2 at a glance 
    26=========================== 
    37 
    4 :Status: Work in progress 
     8:Status: Work in progres 
    59 
    6 TurboGears 2, like TurboGears 1 and many other modern web frameworks, uses a  
    7 pattern called "Model View Controller", or "MVC" pattern.  Basically the MVC  
    8 pattern is an attempt to separate the code which handles what the user sees  
    9 (the view) from the code that responds to user actions (the controller) and  
    10 code that changes the state of data (the model).  
     10TurboGears 2, like TurboGears 1 and many other modern web frameworks, uses a pattern called "Model View Controller", or "MVC" pattern.  Basically the MVC pattern is an attempt to separate the code which handles what the user sees (the view) from the code that responds to user actions (the controller) and code that changes the state of data (the model).  
    1111 
    12 The goal of the MVC pattern is to help you create more flexible software,  
    13 and since web-applications tend to have more user-interface changes than  
    14 anything else, it's particularly designed so that you can change the `view`  
    15 code without necessarily having to change anything else.  
     12The goal of the MVC pattern is to help you create more flexible software, and since web-applications tend to have more user-interface changes than anything else, it's particularly designed so that you can change the `view` code without necessarily having to change anything else.  
    1613 
    17 You have to follow the tutorial `quickstart a project <QuickStart>`_ and serve  
    18 the project first.  If you want to be consistent with the code seen here, call  
    19 your quickstarted project *helloworld*.   If not, you'll just need to update 
    20 the imports in the code, because you'll have a different module name. 
    21  
    22 Then we can play around a little bit with TurboGears 2 and see how it works. 
     14You have to follow the tutorial `quickstart a project <QuickStart>`_ and serve the project first. 
     15Then we could exam some basic moves the you could do with TurboGears 2. 
    2316 
    2417 
     
    2619------------------------------- 
    2720 
    28 Let's take advantage of that fact and make update our view with a Hello World  
    29 headline.  
     21Let's take advantage of that fact and make update our view with a Hello World headline.  
    3022 
    31 To keep the tutorial small and simple, we make a assumption that you already  
    32 have some knowledge about html tags. 
     23To keep the tutorial small and simple, we make a assumption that you already have some knowledge about html tags. 
    3324 
    34 Edit helloworld/templates/index.html, add a <h1> tag at the top of the body  
    35 like this: 
    36  
    37 .. code-block:: html 
     25Edit helloworld/templates/index.html, add a <h1> tag like this:: 
    3826 
    3927  ... 
    4028  <body> 
    41     <h1>Hello World</h1> 
    42     ... 
     29  <h1>Hello World</h1> 
    4330  </body> 
    4431  ... 
    4532 
    46 You can now point your browser at http://localhost:8080 to see the change.  
    47 You should see "Hello, world!" text in h1 size. 
     33Of course you should add <h1> tag somewhere in the body of the template, to make the template as a valid HTML file. 
    4834 
    49 .. note :: Beware to keep the declare description at the top of template file, they will be used in the default template engine (genshi):: 
     35You can now point your browser at http://localhost:8080 to see the change. You should see "Hello, world!" text in h1 size. 
    5036 
    51   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    52   <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/" xmlns:xi="http://www.w3.org/2001/XInclude"> 
    5337 
    5438Hello World using static file 
    5539-------------------------------- 
    5640 
    57 Open a new file, edit the content as a simple html file: 
     41Open a new file, edit the content as a simple html file:: 
    5842 
    59 .. code-block:: html 
    60  
    61     <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/" xmlns:xi="http://www.w3.org/2001/XInclude"> 
    62       <body> 
    63         <h1>Hello World</h1> 
    64       </body> 
     43    <html> 
     44    <body> 
     45    <h1>Hello World</h1> 
     46    </body> 
    6547    </html> 
    6648 
    67 and save it to helloworld/public/hello.html. You can then just browse to  
    68 http://localhost:8080/hello.html and see the page you made.   In general  
    69 TG2 users are advised to put static html, css, and javascript files in  
    70 the public/static directories provided by the quickstart project.   This  
    71 allows you to later set up a front end server (such as apache, or nginx) to  
    72 serve up those files directly, without requiring any work from your TurboGears  
    73 app.  
     49and save it to helloworld/public/hello.html. 
     50 
     51Browse http://localhost:8080/hello.html and see the page. 
    7452 
    7553 
    76 Hello World using just the controller 
    77 ------------------------------------- 
     54Hello World using controller 
     55------------------------------- 
    7856 
    79 The controller defines how the server responds to user actions.   In the case  
    80 of a web framework this almost always means HTTP requests of some kind ( 
    81 either directly initiated by the user/browser, or as fired off by javascript  
    82 as part of an Ajax app).    
     57The controller defines how the server responds to user actions.   In the case of a web framework this almost always means HTTP requests of some kind (either directly initiated, or fired of by javascript as part of an Ajax app).    
    8358 
    84 TurboGears 2 uses an *Object Transversal* system to determine what controller  
    85 method will be called for a particular URL.  Basically you have RootController,  
    86 with @exposed objects which define your URL hierarchy. This means that the  
    87 index method of your RootController is called when you go to /index (or even  
    88 just /).   
    89 We can tell our controller to respond at a new URL by defining a new method.  
     59TurboGears 2 uses an `Object Publishing` system to determine what controller method will be called for a particular URL.  Basically you have RootController, with @exposed objects which define your URL hierarchy. This means that the index method of your RootController is called when you go to /index (or even just /).  We can tell our controller to respond at a new URL by defining a new method.  
    9060 
    91 In this case we will add a new method called hello, which just returns a  
    92 string, which will be returned to the browser directly, without being  
    93 rendered through a template.   
     61In this case we will add a new method called hello, which just returns a string.   TG2 allows us to bypass the template process and return a string directly to the http response, which will be returned to the browser directly.   
    9462 
    95 Edit controller/root.py: 
     63Edit controller/root.py:: 
    9664 
    97 .. code-block:: python 
    98  
    99   from helloworld.lib.base import BaseController 
     65  from my-project-name.lib.base import BaseController 
    10066  from tg import expose 
    10167 
     
    10874          return "Hello World from the controller" 
    10975 
    110  
    11176Browse http://localhost:8080/hello to see the change. 
    11277 
     
    11580----------------------------------------------- 
    11681 
    117 So far we're getting somewhere, we've been returning plaintext for every  
    118 incoming request. But you might have noticed how the default welcome page work.  
     82So far we're getting somewhere, we've been returning plaintext for every incoming request. But you might have noticed how the default welcome page work.  
    11983 
    120 We can edit index template, use controllers to define new url's. But let's  
    121 take it one step further and create yet another new URL, plug plug real  
    122 templates into the controllers, and this time rather than returning a string,  
    123 we'll return a dictionary: 
    124  
    125 .. code-block:: python 
     84We can edit index template, use controllers to define new url's. But let's take it one step further and create yet another new URL, plug plug real templates into the controllers, and this time rather than returning a string, we'll return a dictionary:: 
    12685 
    12786  from helloworld.lib.base import BaseController 
     
    13796 
    13897 
    139 TurboGears sees that the controller returned a dict, and that there's an  
    140 template name defined in the @expose decorator, and renders that template,  
    141 turning the elements of the dictionary into local variables in the template's  
    142 namespace. 
     98TurboGears sees that the controller returned a dict, and that there's an template name defined in the @expose decorator, and renders that template, turning the elements of the dictionary into local variables in the template's namespace. 
    14399 
    144 For each page on your site, you could give each of them the corresponding  
    145 template in your controllers. You could specifying the template argument  
    146 with``@expose`` decorator. 
     100For each page on your site, you could give each of them the corresponding template in your controllers. You could specifying the template argument with``@expose`` decorator. 
    147101 
    148 That means that we've now got a 'hello' variable in our Genshi template which  
    149 we can use, and we attach the template 'helloworld.templates.index' to  
    150 'new_hello' method. So let's edit helloworld/template/index.html to replace  
    151 the h1 tag we added earlier with: 
    152  
    153 .. code-block:: html 
     102That means that we've now got a 'hello' variable in our template which we can use, and we attach the template 'helloworld.templates.index' to 'new_hello' method. So let's edit helloworld/template/index.html to replace the h1 tag we  
     103added earlier with:: 
    154104 
    155105  <h1 py:replace="hello">hello</h1> 
     
    157107Browse http://localhost:8080 to see the change. 
    158108 
    159 Hello from another controller 
    160 _______________________________________ 
     109TurboGears 2 uses the Genshi templating system by deault for controlling dynamic content in your markup. 
     110Template arguments are used to pass variables and other dynamic content to the template. 
    161111 
    162 Perhaps we don't want hello world to happen from the root of our site,  
    163 and perhaps we want to make a lot of modifications to the template 
    164 that renders our view.  In that case, let's create and publish  
    165 a new controller method, with a new template.  
     112To create more skeletons for your templates, just copy the default index.html template that was generated when your project was created. 
    166113 
    167 For now let's just create a new skeleton for our template, by copying  
    168 the default index.html template that was generated when our project 
    169 was created. 
    170114 
    171 Let's call the new template hello.html, and put it in the templates 
    172 directory with index.html.  
    173  
    174 Of course, not every template has dynamic content and therefore  
    175 may not need arguments passed in by the controller. In that case,  
    176 we can just return an empty dictionary, like this: 
    177  
    178 .. code-block:: python 
     115Not every template has dynamic content and therefore may not need arguments. In that case, just return an empty dictionary:: 
    179116 
    180117  @expose(template="helloworld.templates.index") 
    181   def hello(self): 
     118  def index(self): 
    182119      return dict() 
    183  
    184 If you browse to http://localhost:8080/hello you'll see the result: 
    185  
    186 http://localhost:8080  
    187  
    188 .. image:: ../_static/hello-oops.jpg 
    189120 
    190121Oops, we made a mistake!  We're trying to use variables in index.html 
     
    193124TG2 gives you when you get a python exception in your code.  
    194125 
    195 This gives you an opportunity to explore the full stack trace interactively.   
    196 If you click on the little + icon, you can see what local variables are set  
    197 at that frame in the call stack, and you can even use the >>> prompt to type  
    198 in some python code to test what's happening at that level.  
     126TODO: Insert screenshot here.  
     127   
     128This gives you an opportunity to explore the full stack trace interactively.  If you click on the little + icon, you can see what local variables are set at that frame in the call stack, and you can even use the >>> prompt to type in some python code to test what's happening at that level.  
    199129 
    200 In this case, we can see that there are some issues with an undefined hello  
    201 variable.  Which we just added in the last step.     
    202  
    203 That's easy enough to fix let's just return that variable: 
    204  
    205 .. code-block:: python 
    206  
    207   @expose(template="helloworld.templates.index") 
    208   def hello(self): 
    209       return dict(hello='hello') 
     130In this case, we can see that there are some issues with.... 
    210131 
    211132 
    212133Hello World using flash 
    213 --------------------------- 
     134-------------------------------- 
    214135 
    215 The master template we've defined provides yet another way to get a message to 
    216 the next template that's rendered. It automatically looks for a "flash" message 
    217 and displays it for you.   
    218  
    219 This is particularly useful if you don't know which page will be rendered next 
    220 or you just want to let the user know that some action they performed was  
    221 successful.  
    222  
    223 It's easy enought to use the flash feature.  Just edit controller/root.py and 
    224 change the existing 'flash' statement to:: 
     136Edit controller/root.py. Change the 'flash' statement to:: 
    225137 
    226138  flash("Hello World") 
     
    228140Browse http://localhost:8080 to see the change. 
    229141 
    230 Well, that's Hello World.   Hopefully we've given you a quick introduction to  
    231 the TG2 environment, and helped you to understand the MVC archetecture a bit.  
    232142 
    233 If you have any questions feel free to stop by the IRC channel (#turbogears  
    234 on freenode) or ask questions on the mailing list (urbogears@googlegroups.com). 
    235143 
    236 Feel free to play around a bit, and then feel free to look into the Wiki 20  
    237 tutorial which should help you take your TurboGears skills to the next level.  
    238  
  • trunk/docs/2.0/Contributing.rst

    r4396 r4575  
     1##This is an official page. Only editors and admins can change it. 
     2 
     3 
     4 
    15Contributing to TurboGears 
    26========================== 
     7 
     8:status: Official 
     9 
     10.. contents:: 
     11    :depth: 2 
    312 
    413If you want to help out, we want to help you help out! The goal of this  
  • trunk/docs/2.0/Deployment.rst

    r4396 r4575  
    1212 
    1313  paster serve production.ini 
    14  
    15 Of course that assumes you already have a producton.ini.  
    16  
    17 If you don't you can create one with a simple command:: 
    18  
    19   $ paster make-config wiki production.ini 
    20  
    21 You can find out how to control what is produced by the 'paster make-config' command by reading Packaging and Deployment. 
    2214 
    2315But it's also likely that you may want to automatically restart your TG2 app if the server reboots, or you may want to set it up as a windows service. Unfortunately these thing can be very operating system specific, but fortunately they aren't TG2 specific.  
     
    6456 
    6557 * http://docs.turbogears.org/1.0/Deployment 
    66  *  Packaging and Deployment http://wiki.pylonshq.com/display/pylonsdocs/Packaging+and+Deployment 
    67  *  Running Pylons apps with Webservers http://wiki.pylonshq.com/display/pylonsdocs/Running+Pylons+apps+with+Webservers 
    68  * custom error page http://wiki.pylonshq.com/display/pylonsdocs/Interactive+Application+Debuggi 
    6958 
    7059 
  • trunk/docs/2.0/DownloadInstall.rst

    r4568 r4575  
    1 How to install TurboGears 2  
     1 
     2 
     3How to install TurboGears 2 
    24============================= 
    35 
     
    57 
    68We do expect to have a technology preview release sometime soon, and that should provide a clear picture of the TurboGears 2 stack, and a slightly more stable API.   However, if you want API stability and good documentation, you may want to consider building your application on TurboGears 1 and porting it to TG2 after it is officially released. 
     9 
     10Prerequisites: 
     11----------------------- 
     12* gcc 
     13* python 
     14* appropriate python development package (python*-devel python*-dev) 
    715 
    816Installing Pylons: 
     
    3341To tell setuptools to use the version you are editing in the Pylons directory:: 
    3442 
    35   $ cd Pylons   
     43  $ cd Pylons 
    3644  $ python setup.py develop 
    3745 
     
    5159 
    5260 $ cd .. 
    53  $ svn co http://svn.turbogears.org/projects/tg.devtools/trunk tgdev  
    54  $ svn co http://svn.turbogears.org/trunk tg2  
     61 $ svn co http://svn.turbogears.org/projects/tg.devtools/trunk tgdev 
     62 $ svn co http://svn.turbogears.org/trunk tg2 
    5563 $ svn co http://svn.turbogears.org/projects/tgrepozewho/trunk tgrepozewho 
    56  
    57 And then install Paver which manages TG2's build:: 
    58  
    59  easy_install Paver 
    6064 
    6165tg2 package is TurboGears 2 core. Others are paster command plugins to create default template, admin interface, and migrations. 
     
    6569Install tgrepozewho:: 
    6670 
    67  $ cd tgrepozewho  
     71 $ cd tgrepozewho 
    6872 $ python setup.py develop 
    6973 
    7074Install TurboGears 2 server:: 
    7175 
    72  $ cd ..  
    73  $ cd tg2   
    74  $ paver develop 
     76 $ cd .. 
     77 $ cd tg2 
     78 $ python setup.py develop 
    7579 
    7680Install TurboGears 2 developer tools:: 
    7781 
    78  $ cd ..  
    79  $ cd tgdev  
     82 $ cd .. 
     83 $ cd tgdev 
    8084 $ python setup.py develop 
    8185 
    8286Then you have installed TurboGears 2. 
    8387 
    84  .. note:: if you have installed old dependency packages, you could remove them from ``{python_path}/site-packages/easy_install.pth`` 
     88 .. note:: if you have installed old dependency packages, you could remove them from:: 
     89 
     90 {python_path}/site-packages/easy_install.pth 
     91 
    8592 
    8693Validate the installation: 
     
    95102Paster has replaced the old tg-admin command, and most of the tg-admin commands have now been reimplemented as paster commands. For example, "tg-admin quickstart" command has changed to "paster quickstart" command, and "tg-admin info" command has changed to "paster tginfo" command. 
    96103 
    97 Be sure to check out our `What's new in TurboGears 2.0 <2.0/RoughDocs/WhatsNew>`_ page to get a picture of what's changed in TurboGears2 so far. 
     104Be sure to check out our `What's new in TurboGears 2.0 <RoughDocs/WhatsNew>`_ page to get a picture of what's changed in TurboGears2 so far. 
    98105 
    99106Troubleshooting 
     
    105112 
    106113 . $ sudo easy_install -U -f http://toscawidgets.org/download/wo_speedups/ RuleDispatch 
    107   
    108114If you get the following error when starting a project with ``paster serve``:: 
    109115 
    110116 . AttributeError: 'WSGIRequest' object has no attribute 'accept_language' 
    111   
    112117update your Pylons checkout with ``hg update`` and try again. 
    113118 
     
    146151  $ cd RuleDispatch-0.5a0.dev-r2306 
    147152  $ python setup.py develop 
    148    
     153 
     154If you get this error about webhelpers, you need the latest version from mercurial:: 
     155 
     156  $ hg clone https://www.knowledgetap.com/hg/webhelpers 
     157  $ cd webhelpers 
     158  $ python setup.py develop 
  • trunk/docs/2.0/Profile.rst

    r4396 r4575  
     1## Please see the page "DocHelp" for guidelines on contributing TurboGears documentation! 
     2 
     3 
     4 
    15Profiling your app 
    26================== 
    37 
    48:Status: Work in progress 
     9 
     10.. contents:: Table of Contents 
     11    :depth: 2 
     12 
    513 
    614TurboGears does not come with a built-in profiler, but an easy to use WSGI application profiler is just an easy_install away!  
     
    2230--------------------------- 
    2331 
    24 Just fire up a browser or functional test-runner like twill, or ab (apache bench).  The repoze.profile middleware will profile everything above it in the WSGI stack.  
     32Just fire up a browser (or functional test-runner like twill, ab (apache bench), or whatever).   The repoze.profile middleware will profile everything above it in the WSGI stack.  
    2533 
    2634 
     
    2836--------------------------- 
    2937 
    30 There's a built in web based view of your profile data available if you browse to??? 
     38There's a built in web based view of your profile data available.... 
     39 
     40 
    3141 
    3242Reference: 
  • trunk/docs/2.0/QuickStart.rst

    r4562 r4575  
     1 
     2 
     3 
    14Quickstarting a TurboGears 2 project 
    25==================================== 
     
    47:Status: Work in progres 
    58 
     9.. contents:: Table of Contents 
     10    :depth: 2 
    611 
    7 Once you've got TurboGears 2 installed, you probably want to try it out. To  
    8 make setting up a new project very quick, TurboGears 2 extends the 'paster'  
    9 command line tool to provide a suite of tools for working with TurboGears 2  
    10 projects. A few will be touched upon in this tutorial, check the 'paster --help' 
    11 command for a full listing. 
    1212 
    13 The first paster tool you'll need is 'quickstart', which initializes a  
    14 TurboGears 2 project. 
     13Now that you've got TurboGears installed. TurboGears 2 extends the 'paster' command line tool to provide a suite of tools for working with TurboGears 2 projects. A few will be touched upon in this tutorial, check the 'paster --help' command for a full listing. 
    1514 
    16 To use it go to whatever directory you want your project to be in, and type:: 
     15The very first tool you'll need is 'paster quickstart', which initializes a TurboGears 2 project. 
     16You can go to whatever directory you want and start a new turbogears 2 project by typing:: 
    1717 
    1818  $ paster quickstart Helloworld 
    1919 
    20 The 'paster quickstart' command will create a basic project directory for you to  
    21 use to get started on your TurboGears 2 application. You'll be prompted for the  
    22 name of the project (this is the pretty name that human beings would appreciate), 
    23 and the name of the package (this is the less-pretty name that Python will like). 
    24  
    25 For the identity prompt, answer 'no' (or press 'Enter' key directly), since we'll keep this tutorial fairly simple, but when you need users/passwords in a future project, you'll want to look up the identity management tutorial. 
     20So 'paster quickstart' command will create a basic project directory for you to use to get started on your TurboGears 2 application. You'll be prompted for the name of the project (this is the pretty name that human beings would appreciate), and the name of the package (this is the less-pretty name that Python will like). 
    2621 
    2722Here's what our choices for this tutorial look like:: 
     
    2924    Enter project name: Helloworld 
    3025    Enter package name [helloworld]: helloworld 
    31     Do you need Identity (usernames/passwords) in this project? [no] 
    3226    ...output... 
    3327 
    34 This will create a new directory which contains a few files in a directory tree, 
    35 with some code already set up for you. 
     28This will create a new directory which contains a few files in a directory tree, with some code already set up for you. 
    3629 
    3730Let's go in there and you can take a look around:: 
     
    3932  $ cd helloworld 
    4033 
    41 .. note:: you could type following command to check the full quickstart capabilities:: 
    42  
    43   $ paster quickstart --help 
    4434 
    4535Run the server 
    4636--------------- 
    4737 
    48 At this point your project should be operational. To start your new TurboGears 2 
    49 app, cd into the new directory ( helloworld ) and issue the second paster  
    50 command 'paster serve' to serve your new application:: 
     38At this point your project should be operational. To start your new TurboGears 2 app, cd into the new directory ( helloworld ) and issue the second paster command 'paster serve' to serve your new application:: 
    5139 
    5240  $ paster serve development.ini 
    5341 
    54 As soon as that's done. Point your browser at http://localhost:8080/, and  
    55 you'll see a nice welcome page with the inform(flash) message and current time. 
     42As soon as that's done. Point your browser at http://localhost:8080/, and you'll see a nice welcome page with the inform(flash) message and current time. 
    5643 
    57 .. note:: 
     44If you're exploring TurboGears 2 after using TurboGears 1, you may notice that the old config file `dev.cfg` file is now `development.ini`. 
     45And by default the 'paster serve' is not in auto-reload mode. 
    5846 
    59   If you're exploring TurboGears 2 after using TurboGears 1, you may notice that  
    60   the old config file `dev.cfg` file is now `development.ini`. 
    61  
    62 Reload the server automatically 
    63 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    64  
    65 Also note that by default 'paster serve' is *not* in auto-reload mode. 
    66  
    67 If you want your application to auto-reload whenever you change a  
    68 source code file as was the default in a TurboGears 1's dev.fg, just add  
    69 a `--reload` option.  So, to get reloading you'd just type this instead:: 
     47If you also want your application to auto-reload whenever you change a source code file as was the default in a TurboGears 1's dev.fg, just add a `--reload` option.  So, to get reloading you'd just type this instead:: 
    7048 
    7149  $ paster serve --reload development.ini 
     
    7351Then you could access http://localhost:8080 to view the running TurboGears app. 
    7452 
    75 .. note:: you could type following command to check the full quickstart capabilities:: 
     53If you take a look at the code that quickstart created, you'll see that there isn't much involved in getting up and running. 
    7654 
    77   $ paster serve --help 
     55In particular, you'll want to check out the files directly involved in displaying this welcome page: 
    7856 
    79 Glancing the Source 
    80 -------------------- 
     57  * development.ini : The system configuration is laid on development.ini for development configuration 
     58  * helloworld/controllers/root.py is responsible to generate the welcome page. 
     59  * helloworld/templates/index.html is the template you view on the welcome screen. It's an standard XHTML with some simple namespaced attributes. You can even preview it directly by open it in your browser! Very designer-friendly. 
     60  * helloworld/public/ is the place to hold static files, such as pictures, javascript, or css files. 
    8161 
    82 If you take a look at the code that quickstart created, you'll see that  
    83 there isn't much involved in getting up and running. 
    84  
    85 In particular, you'll want to check out the files directly involved in  
    86 displaying this welcome page: 
    87  
    88   * development.ini : The system configuration is laid on development.ini  
    89     for development configuration 
    90   * helloworld/controllers/root.py : The python file is responsible to generate the welcome page. 
    91   * helloworld/templates/index.html : The html template is the template you 
    92     view on the welcome screen. It's an standard XHTML with some simple 
    93     namespaced attributes.  
    94     You can even preview it directly by open it in your browser! Very  
    95     designer-friendly. 
    96   * helloworld/public/ : The place to hold static files, such as pictures,  
    97     javascript, or css files. 
    98  
    99 Change the server port 
    100 ~~~~~~~~~~~~~~~~~~~~~~~ 
    101  
    102 You could edit development.ini to change the default server port used by the  
    103 built-in web server:: 
     62You could edit development.ini to change the default server port used by the built-in web server:: 
    10463 
    10564  [server:main] 
  • trunk/docs/2.0/RoughDocs/BootStrap.rst

    r4562 r4575  
    5656-------------- 
    5757 
    58 .. note:: the crud command should only work **inside** a project directory 
    59  
    6058You could use paster command to create a customizable interface to Create, Read, Update, Delete records  
    6159(CRUD) based on model :: 
     
    7270  $ paster crud -i id Movie MovieController 
    7371 
    74 The command Create several files for you: 
     72The command Create several files 
    7573 
    76  * controllers/moviecontroller.py 
    77  * controllers/movieform.py 
    78  * templates/moviecontroller/list.html 
    79  * templates/moviecontroller/show.html 
    80  * templates/moviecontroller/new_form.html 
    81  * templates/moviecontroller/edit_form.html 
    82  * templates/moviecontroller/master.html 
     74 * controllers/MovieController.py 
     75 * controllers/MovieForm.py 
     76 * templates/MovieController/list.html 
     77 * templates/MovieController/show.html 
     78 * templates/MovieController/form.html 
    8379 
    8480Edit controllers/root.py:: 
     
    112108  >>> from toscawidgets.widgets import forms 
    113109  >>> dir(forms) 
    114    
    115   or runs paster tginfo command to browse all available widgets:: 
    116  
    117   $ paster tginfo 
    118110 
    119111 
     112 
  • trunk/docs/2.0/RoutesIntegration.rst

    r4396 r4575  
    66:Status: Work in progress 
    77 
     8.. contents:: Table of Contents 
     9    :depth: 2 
    810 
    9 TurboGears2 does URL dispatch with a combination of TG1 style object dispatch,  
    10 and built in Routes integration.  By default you don't need to think about  
    11 Routes at all, because the framework sets up a default route to your  
    12 RootController, which sees that the action is route, and does object dispatch  
    13 in the same way that TurboGears 1 did.   
     11TurboGears2 does URL dispatch with a combination of TG1 style object dispatch, and built in Routes integration.  By default you don't  
     12need to think about Routes at all, because the framework sets up a default route to your RootController, which sees that the action is route, and does object dispatch in the same way that TurboGears 1 did.   
    1413 
    15 But if you want to create special routes that overide Object Dispatch, you can  
    16 easily do that, just by providing your own function to setup the routes map.   
    17 TurboGears has a defaults module, which provides a make_default_route_map  
    18 function like this :: 
     14But if you want to create special routes that overide Object Dispatch, you can easily do that, just by providing your own function to setup the routes map.  TurboGears has a setup module, which provides a make_default_route_map function like this :: 
    1915 
    2016  from pylons import config 
     
    2622                  always_scan=config['debug']) 
    2723                 
    28       ## Replace the next line with your overides.   Overides should generally  
    29       ## come before the default route defined below 
     24      ## Replace the next line with your overides.   Overides should generally come 
     25      ## before the default route defined below 
    3026      # map.connect('overide/url/here', controller='mycontrller', action='send_stuff') 
    3127     
     
    3531      return map 
    3632 
    37 There's a single map.connect() call which sets up all urls (via the * wildcard)  
    38 assigns them to the URL param, and sends them to the RootController in the  
    39 root.py file in your project's controllers folder.  The default environment.py  
    40 file in your config directory takes this and assigns it to make_map, which is  
    41 passed in as a configuration element to the RoutesMiddleware setup in  
    42 middleware.py.:: 
     33There's a single map.connect() call which sets up all urls (via the * wildcard) assigns them to the URL param, and sends them to the RootController in the root.py file in your project's controllers folder.  The default environment.py file in your config directory takes this and assigns it to make_map, which is passed in as a configuration element to the RoutesMiddleware setup in middleware.py.:: 
    4334 
    4435    # This setups up a set of default route that enables a standard 
     
    4839    make_map = setup.make_default_route_map 
    4940 
    50 To define your own custom routes, all you need to do is to replace this with  
    51 your own make_map implementation.  If you want you can set up object dispatch  
    52 from places other than root.py, or even use routes to define all of your URLs.  
    53 If you are going to do object dispatch, make sure the controller that you  
    54 dispatch too inherits from TGController, since that's the controller that  
    55 knows how to do internal dispatch.  
     41To define your own custom routes, all you need to do is to replace this with your own make_map implementation.  If you want you can set up object dispatch from places other than root.py, or even use routes to define all of your URLs. If you are going to do object dispatch, make sure the controller that you dispatch too inherits from TGController, since that's the controller that knows how to do internal dispatch.  
    5642  
    5743For more information about how to write routes, you might want to read: 
  • trunk/docs/2.0/SimpleWidgetForm.rst

    r4370 r4575  
     1## This is a contributed page. You must be logged in to change it. 
     2#acl EditorGroup:read,write Known:read,write All:read 
     3 
    14 
    25 
     
    811.. contents:: Table of Contents 
    912   :depth: 2 
     13 
    1014 
    1115This tutorial introduces you to the widget form system by building a simple 
  • trunk/docs/2.0/ToolBox.rst

    r4396 r4575  
    44========== 
    55 
    6 :Status: Work in progress 
     6:Status: Work in progres 
     7 
     8.. contents:: Table of Contents 
     9    :depth: 2 
    710 
    811Goal 
    912-------- 
    1013 
    11 A platform to share "gadgets" designed to aid the development of various TurboGears projects
     14A platform to share gadgets which helps the development
    1215 
    13 The toolbox uses an extensible plugin system, so that TG develoers can easily release their own ToolBox enabled gadgets on pypi. 
     16Developer could release their own gadgets on pypi. 
     17The gadgets will auto-plugged in TurboGears 2 toolbox through setuptools. 
    1418 
    15 If a few simple steps are taken to register gadgets appropriately, as soon as a gadget is easy_installed it will be automatically plugged in TurboGears 2 toolbox via it's setuptools entry point. 
     19ToolBox itself is a TurboGears 2 Application. Developers could use the same skill as develop TurboGears 2 application to develop a toolbox Gadget. 
    1620 
    17 The Toolbox and Toolbox gadgets are themselves  TurboGears 2 Applications. So, anybody who can write a TG2 application, can with a little extra work create toolbox gadgets. 
    1821 
    1922Terminology 
    2023------------ 
    2124 
    22  * Gadget: A TG2 application designed to work within toolbox. Some of them may also be designed to be embedded inside end-user applications
     25 * Gadget: The application work within toolbox. Some of them may allow you to embed in your application
    2326 
    2427Features 
  • trunk/docs/2.0/ToscaWidgets/Using.rst

    r4396 r4575  
     1 
     2 
    13 
    24Using Existing Widgets 
    35====================== 
     6 
    47 
    58Finding Existing Widgets 
  • trunk/docs/2.0/Wiki20/JSONMochiKit.rst

    r4374 r4575  
    3939---------------------- 
    4040 
    41 For the client side of this tutorial, we'll be using MochiKit.  
     41For the client side of this tutorial, we'll be using MochiKit, the official 
     42javascript framework of TurboGears. The two are only loosely coupled, as 
     43opposed to prototype/Rails, but we find MochiKit to provide a very elegant 
     44Python-inspired API while avoiding monkeypatches on the JavaScript datatypes. 
    4245 
    4346To keep this from turning into a javascript tutorial (it's pretty long as-is 
     
    4649the pagelist and include it right in the page you're viewing. 
    4750 
    48 The first thing we need to do is have MochiKit included in all of our pages.  
    49 This can be done by editing the ``master.html`` file or by having TurboGears  
    50 add it as a widget.  
    51  
    52 The first thing you'll need to do is download and install the tw.mochikit  
    53 package:: 
    54  
    55   easy_install tw.mochikit 
    56  
    57 TODO:  Add the toscawidget stuff here.  
     51The first thing we need to do is have MochiKit included in all of our pages. This can be done by editing the ``master.kid`` file or by having TurboGears add it as a widget. We'll use the latter technique here. 
     52 
     53Open the ``wiki20/config/app.cfg``. This file controls environment-independent settings like identity and output encoding. Search through the file for the ``tg.include_widgets`` setting, uncomment it, and modify it like so:: 
     54 
     55    tg.include_widgets = ['turbogears.mochikit'] 
     56 
     57As the name indicates, we actually are using TurboGears' widget infrastructure 
     58to do the inclusion. Widgets are an advanced feature and are out of scope for 
     59this tutorial, but they're essentially self-contained bundles of HTML+behavior 
     60code that make building forms a snap. One of the things they can do is include 
     61javascript in a page and the ``turbogears.mochikit`` takes advantage of this to 
     62provide a javascript library. The `cogbin`_ has other javascript libraries 
     63packed up as widgets that can be used the same way. 
     64 
     65.. _cogbin: http://www.turbogears.org/cogbin/ 
     66 
     67After making this configuration change, **restart the server.** The auto-reload functionality only detects changes to python files. 
     68 
    5869 
    5970Prep the page 
    6071------------- 
    6172 
    62 Now that we have MochiKit, we're ready to modify our template. We'll practice good style by progressively enhancing our pagelist link in ``master.html``: 
     73Now that we have MochiKit, we're ready to modify our template. We'll practice good style by progressively enhancing our pagelist link in ``master.kid``: 
    6374 
    6475.. parsed-literal:: 
     
    7687they have JavaScript enabled or not. 
    7788 
     89 
    7890The main event 
    7991-------------- 
    8092 
    81 In the interest of expediency (and because we're substituting URLs with gensh), 
     93In the interest of expediency (and because we're substituting URLs with Kid), 
    8294we'll add the handler to a ``<script>`` tag in the head rather than in its own 
    8395file. 
  • trunk/INSTALL.txt

    r4370 r4575  
    4848 
    4949    $ hg clone https://www.knowledgetap.com/hg/pylons-dev pylons 
    50     $ hg clone https://https://www.knowledgetap.com/hg/webhelpers/ webhelpers 
     50    $ hg clone https://www.knowledgetap.com/hg/webhelpers/ webhelpers 
    5151    $ svn co http://svn.turbogears.org/trunk tg2 
    5252 
     
    6969    $ svn update 
    7070    $ python setup.py develop 
     71 
     72To update the Pylons and webhelpers sources: 
     73 
     74    $ cd ../webhelpers 
     75    $ hg pull; hg update 
     76    $ cd ../pylons 
     77    $ hg pull; hg update 
    7178 
    7279