diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2011-09-27 17:35:51 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2011-09-27 17:36:11 +0200 |
commit | 1eceabf7743ca9ab8c5c5dc199a6977a84f830b7 (patch) | |
tree | 937a6494b52600431a530797b177f270bd0070ca | |
parent | bc18f1c2419002208d1a9c19c45cb988e516348e (diff) | |
download | sites-1eceabf7743ca9ab8c5c5dc199a6977a84f830b7.tar.gz sites-1eceabf7743ca9ab8c5c5dc199a6977a84f830b7.tar.bz2 sites-1eceabf7743ca9ab8c5c5dc199a6977a84f830b7.zip |
added possibility to run as fastcgi
-rwxr-xr-x | index.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1,7 +1,7 @@ #!/usr/bin/env python -from web import template, form, application, ctx from socket import gethostbyaddr +from web import template, form, application, ctx, wsgi urls = ( r'/', 'index', @@ -12,6 +12,8 @@ urls = ( ) render = template.render('templates/', base='layout'); +app = application(urls, globals(), autoreload=False) + create_form = form.Form( form.Textbox('name', @@ -54,5 +56,7 @@ class new: if __name__ == "__main__": - app = application(urls, globals(), autoreload=False) + if ('--fastcgi' in sys.argv): + wsgi.runwsgi = lambda func, addr=None: wsgi.runfcgi(func, addr) + app.run() |