TurboGears 2 is built on top of the experience of several next generation web frameworks including TurboGears 1 (of course), Django, and Rails. All of these frameworks had limitations that frustrated us, and TG2 was built as an answer to that frustration:
TurboGears can start as a single file app through its minimal mode setup:
from wsgiref.simple_server import make_server from tg import expose, TGController, AppConfig class RootController(TGController): @expose() def index(self): return "<h1>Hello World</h1>" config = AppConfig(minimal=True, root_controller=RootController()) print "Serving on port 8080..." httpd = make_server('', 8080, config.make_wsgi_app()) httpd.serve_forever()
which you can then run on Python itself:
$ pip install TurboGears2 $ python myapp.py
or follow TurboGears on Google+ for the latest news!
Or set it up in a virtual environment on your machine:
$ virtualenv --no-site-packages tg2env $ cd tg2env/ $ source bin/activate (tg2env)$ pip install tg.devtools (tg2env)$ gearbox quickstart example (tg2env)$ cd example/ (tg2env)$ pip install -e . (tg2env)$ gearbox serve