Fork me on GitHub

The Web Framework that scales with you.

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:

Start Small

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 Scale to a FullStack Solution

TurboGears can scale to a full stack solution for more complex applications using TurboGears devtools:

$ pip install tg.devtools
$ gearbox quickstart myproj

The newly created myproj application can be started with the Gearbox toolchain:

$ cd myproj
$ pip install -e .
$ gearbox serve

Feature Complete and Flexible

or follow TurboGears on Google+ for the latest news!

Give It a Try

TurboGears 2 works on Python 2.6, 2.7, 3.2, 3.3 and 3.4.
Try it now, in your browser, using Runnable

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

Get started Learning TurboGears 2 by looking at Documentation and our famous wiki tutorial.