Massive changes. Added long-polling support
[flowspy] / poller / application.py
diff --git a/poller/application.py b/poller/application.py
new file mode 100644 (file)
index 0000000..cb48532
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/python
+from gevent import monkey; monkey.patch_all()
+import os
+import traceback
+from django.core.handlers.wsgi import WSGIHandler
+from django.core.signals import got_request_exception
+from django.core.management import call_command
+
+os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
+
+def exception_printer(sender, **kwargs):
+    traceback.print_exc()
+
+got_request_exception.connect(exception_printer)
+
+call_command('syncdb')
+
+application = WSGIHandler()