Split off the Tornado code into a separate process

(imported from commit 95dbd0f438cdba06d6e6c6c539a2a3d49c577cfd)
This commit is contained in:
Keegan McAllister
2012-10-09 16:21:03 -04:00
parent f0d4cc3d42
commit 5e70b5a291
5 changed files with 39 additions and 6 deletions

View File

@@ -84,14 +84,11 @@ class Command(BaseCommand):
print "Tornado server is running at http://%s:%s/" % (addr, port)
print "Quit the server with %s." % quit_command
from tornado.web import FallbackHandler
django_app = wsgi.WSGIContainer(WSGIHandler())
try:
# Application is an instance of Django's standard wsgi handler.
application = web.Application([(r"/json/get_updates", AsyncDjangoHandler),
(r"/api/v1/get_messages", AsyncDjangoHandler),
(r".*", FallbackHandler, dict(fallback=django_app)),
(r"/notify_waiting_clients", AsyncDjangoHandler),
], debug=django.conf.settings.DEBUG)
# start tornado web server in single-threaded mode