Speed up development with full-stack environments for every branch.

Learn More

Basic TurboGears Example [Python]

Forked from Basic Flask Example.

8745 Runs 12451 Views 537 Copies
Saved

Saved

amol 16

amol
published 3 years ago

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 80..."
httpd = make_server('', 80, config.make_wsgi_app())
httpd.serve_forever()
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).