From 1eceabf7743ca9ab8c5c5dc199a6977a84f830b7 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 27 Sep 2011 17:35:51 +0200 Subject: added possibility to run as fastcgi --- index.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.py b/index.py index 27a5cf3..26351bb 100755 --- a/index.py +++ b/index.py @@ -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() -- cgit v1.2.3-1-g7c22