Last active
April 17, 2016 18:02
-
-
Save amol-/204cb8eec2d7389eecc112bf93d62d12 to your computer and use it in GitHub Desktop.
Oneline TurboGears2 web application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tg import expose, TGController, AppConfig | |
from wsgiref.simple_server import make_server | |
make_server('', 8080, AppConfig( | |
minimal=True, | |
root_controller=type('RootController', (TGController,), { | |
'index': expose()(lambda *args, **params: 'Hello World') | |
})() | |
).make_wsgi_app()).serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just run this with
python tgoneline.py
I reindented it for readability but this can be collapsed as a oneliner: