TurboGears is an ObjectDispatch based Python web development framework made for rapid projects development.
from tg import expose
from helloworld.lib.base import BaseController
class RootController(BaseController):
@expose()
def index(self):
return "<h1>Hello World</h1>"
TurboGears is meant to run inside python virtualenv and provides its own private index to avoid messing with your system packages and to provide a reliable set of packages that will correctly work together.
$ virtualenv --no-site-packages tg2env
$ source tg2env/bin/activate
(tg2env)$ easy_install -i http://tg.gy/current tg.devtools
To try TurboGears feel free to quickstart a new TurboGears application and start playing around:
(tg2env)$ paster quickstart -n -x example
(tg2env)$ cd example/
(tg2env)$ python setup.py develop
(tg2env)$ paster serve development.ini
Visiting http://localhost:8080/index you will see a ready made sample application with a brief introduction to the framework itself.
Explore the TurboGears Tutorials to get started with TurboGears!