| 4 | | Installing TurboGears 2 currently requires you to be willing to checkout both the Pylons and TurboGears 2 code from their respective version control systems. TurboGears 2 is working well, and there is at least one large project built upon it already, but it's not yet documented and ready for users who aren't ready to deal with the current rate of change in the project. |
|---|
| 5 | | |
|---|
| 6 | | We 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. |
|---|
| | 4 | Installing Turbogears2 has been made simple with the advent of the package index. We recommend installing Turbogears2 into a virtual environment |
|---|
| | 5 | so that any existing packages will not interfere. The basic installation goes as follows: |
|---|
| | 6 | |
|---|
| | 7 | 1. Install setuptools |
|---|
| | 8 | |
|---|
| | 9 | 2. Install virtualenv |
|---|
| | 10 | |
|---|
| | 11 | 3. Create a virtualenv for your project |
|---|
| | 12 | |
|---|
| | 13 | 4. switch to the virtualenv |
|---|
| | 14 | |
|---|
| | 15 | 5. easy_install turbogears development package |
|---|
| | 16 | |
|---|
| | 17 | 6. profit. |
|---|
| | 18 | |
|---|
| 17 | | You could easy_install pylons with command:: |
|---|
| 18 | | |
|---|
| 19 | | $ easy_install -f http://pylonshq.com/download/0.9.7 -U Pylons |
|---|
| | 28 | $ curl http://peak.telecommunity.com/dist/ez_setup.py | sudo python |
|---|
| | 29 | |
|---|
| | 30 | |
|---|
| | 31 | Setting up a Virtual Environment: |
|---|
| | 32 | ----------------------------------- |
|---|
| | 33 | |
|---|
| | 34 | $ sudo easy_install virtualenv |
|---|
| | 35 | |
|---|
| | 36 | produces: |
|---|
| | 37 | :: |
|---|
| | 38 | |
|---|
| | 39 | Searching for virtualenv |
|---|
| | 40 | Reading http://pypi.python.org/simple/virtualenv/ |
|---|
| | 41 | Best match: virtualenv 1.1 |
|---|
| | 42 | Downloading http://pypi.python.org/packages/2.5/v/virtualenv/virtualenv-1.1-py2.5.egg#md5=1db8cdd823739c79330a138327239551 |
|---|
| | 43 | Processing virtualenv-1.1-py2.5.egg |
|---|
| | 44 | creating /Users/percious/oss/tgdev/lib/python2.5/site-packages/virtualenv-1.1-py2.5.egg |
|---|
| | 45 | Extracting virtualenv-1.1-py2.5.egg to /Users/percious/oss/tgdev/lib/python2.5/site-packages |
|---|
| | 46 | Adding virtualenv 1.1 to easy-install.pth file |
|---|
| | 47 | Installing virtualenv script to /Users/percious/oss/tgdev/bin |
|---|
| | 48 | |
|---|
| | 49 | Installed /Users/percious/oss/tgdev/lib/python2.5/site-packages/virtualenv-1.1-py2.5.egg |
|---|
| | 50 | Processing dependencies for virtualenv |
|---|
| | 51 | Finished processing dependencies for virtualenv |
|---|
| | 52 | |
|---|
| | 53 | $ virtualenv tg2env --no-site-packages |
|---|
| | 54 | produces: |
|---|
| | 55 | :: |
|---|
| | 56 | |
|---|
| | 57 | Using real prefix '/usr/local' |
|---|
| | 58 | New python executable in tgdev/bin/python |
|---|
| | 59 | Installing setuptools............done. |
|---|
| | 60 | |
|---|
| | 61 | $ cd tg2env |
|---|
| | 62 | |
|---|
| | 63 | $ source bin/activate |
|---|
| | 64 | and now your prompt should look something like: |
|---|
| | 65 | :: |
|---|
| | 66 | |
|---|
| | 67 | (tg2dev)usrname@host:tgdev $ |
|---|
| | 68 | |
|---|
| | 69 | Install Turbogears2: |
|---|
| | 70 | --------------------- |
|---|
| | 71 | $ easy_install -i http://www.turbogears.org/2.0/downloads/1.9.7a1/index tg.devtools |
|---|
| | 72 | |
|---|
| | 73 | a whole bunch of packages should download. (this will take a little while) |
|---|
| | 74 | |
|---|
| | 75 | Validate the installation: |
|---|
| | 76 | ---------------------------- |
|---|
| | 77 | |
|---|
| | 78 | To check if you installed TurboGears 2 correctly, type |
|---|
| | 79 | |
|---|
| | 80 | $ paster --help |
|---|
| | 81 | |
|---|
| | 82 | should look something like: |
|---|
| | 83 | :: |
|---|
| | 84 | |
|---|
| | 85 | Usage: paster [paster_options] COMMAND [command_options] |
|---|
| | 86 | |
|---|
| | 87 | Options: |
|---|
| | 88 | --version show program's version number and exit |
|---|
| | 89 | --plugin=PLUGINS Add a plugin to the list of commands (plugins are Egg |
|---|
| | 90 | specs; will also require() the Egg) |
|---|
| | 91 | -h, --help Show this help message |
|---|
| | 92 | |
|---|
| | 93 | Commands: |
|---|
| | 94 | create Create the file layout for a Python distribution |
|---|
| | 95 | help Display help |
|---|
| | 96 | make-config Install a package and create a fresh config file/directory |
|---|
| | 97 | points Show information about entry points |
|---|
| | 98 | post Run a request for the described application |
|---|
| | 99 | request Run a request for the described application |
|---|
| | 100 | serve Serve the described application |
|---|
| | 101 | setup-app Setup an application, given a config file |
|---|
| | 102 | |
|---|
| | 103 | TurboGears2: |
|---|
| | 104 | quickstart Create a new TurboGears 2 project. |
|---|
| | 105 | tginfo Show TurboGears 2 related projects and their versions |
|---|
| | 106 | |
|---|
| | 107 | |
|---|
| | 108 | and you'll see a new "TurboGears2" command section in paster help. |
|---|
| | 109 | |
|---|
| | 110 | Paster 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. |
|---|
| | 111 | |
|---|
| | 112 | Be sure to check out our `What's new in TurboGears 2.0 <WhatsNew.html>`_ page to get a picture of what's changed in TurboGears2 so far. |
|---|
| | 113 | |
|---|
| | 114 | Special Considerations: |
|---|
| | 115 | ---------------------------- |
|---|
| | 116 | |
|---|
| | 117 | **Cygwin** does not include the necessary binary file **sqlite3.dll**; if you want to run cygwin you'll need to install a different database. If you have cygwin installed and you want to use the default setup described here, you must perform all operations, including setup operations, within DOS command windows, not cygwin command windows. |
|---|
| | 118 | |
|---|
| | 119 | |
|---|
| | 120 | Installing the development version of Turbogears2 (from source) |
|---|
| | 121 | ================================================================ |
|---|
| | 122 | |
|---|
| 140 | | It is possible you might see a few other error messages. Here are the correct way to fix the dependency problems so things will install properly. |
|---|
| 141 | | |
|---|
| 142 | | If you get this error about PyProtocols:: |
|---|
| 143 | | |
|---|
| 144 | | error: Could not find suitable distribution for Requirement.parse('PyProtocols>=1.0a0dev-r2302') |
|---|
| 145 | | |
|---|
| 146 | | Then do this:: |
|---|
| 147 | | |
|---|
| 148 | | $ wget http://dbsprockets.googlecode.com/files/PyProtocols-1.0a0dev-r2302.zip |
|---|
| 149 | | $ unzip PyProtocols-1.0a0dev-r2302.zip |
|---|
| 150 | | $ cd PyProtocols-1.0a0dev-r2302 |
|---|
| 151 | | $ python setup.py develop |
|---|
| 152 | | |
|---|
| 153 | | |
|---|
| 154 | | If you get this error about RuleDispatch:: |
|---|
| 155 | | |
|---|
| 156 | | error: Could not find suitable distribution for Requirement.parse('RuleDispatch>=0.5a0.dev-r2306') |
|---|
| 157 | | |
|---|
| 158 | | Then you need to do the following:: |
|---|
| 159 | | |
|---|
| 160 | | $ cd .. |
|---|
| 161 | | $ wget http://dbsprockets.googlecode.com/files/RuleDispatch-0.5a0.dev-r2306.tar.gz |
|---|
| 162 | | $ tar xzf RuleDispatch-0.5a0.dev-r2306.tar.gz |
|---|
| 163 | | $ cd RuleDispatch-0.5a0.dev-r2306 |
|---|
| 164 | | $ python setup.py develop |
|---|