summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2011-09-27 17:35:51 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2011-09-27 17:36:11 +0200
commit1eceabf7743ca9ab8c5c5dc199a6977a84f830b7 (patch)
tree937a6494b52600431a530797b177f270bd0070ca
parentbc18f1c2419002208d1a9c19c45cb988e516348e (diff)
downloadsites-1eceabf7743ca9ab8c5c5dc199a6977a84f830b7.tar.gz
sites-1eceabf7743ca9ab8c5c5dc199a6977a84f830b7.tar.bz2
sites-1eceabf7743ca9ab8c5c5dc199a6977a84f830b7.zip
added possibility to run as fastcgi
-rwxr-xr-xindex.py8
1 files 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()