Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Integrating Django with Tornado's web server (groups.google.com)
56 points by apgwoz on Sept 13, 2009 | hide | past | favorite | 8 comments


For what it's worth, here is a (bleeding edge) way to run Django with Twisted: http://clemesha.org/blog/2009/apr/23/Django-on-Twisted-using.... Full working example code is linked from the article.

With this you get the benefit of being self-contained and you get Django with all it's joys plus Twisted for your long-polling, etc.


FYI, the instructions referenced in this message with Django/Tornado getting started code is at http://groups.google.com/group/django-users/browse_thread/th...


What is the virtue of running a Django application on Tornado over Apache or lighttpd?


It may actually be faster, but I am still getting the load test environment set up. I will post the load tests here or on my blog when I run tests.

Mainly, I wanted to make sure Tornado integrates with existing frameworks so that more people can play with it, and the separable parts are useful to people who don't want to use the whole Tornado stack.


Running this (for me) has a lot, a lot of advantages over using apache. Not the least of which is it's microscopic compared to Apache. I'll be very interested in this; and might take the django bit for a spin this week. Thank you.


Not having to deal with Apache is its own reward :)

Seriously, having a self-contained server is often nice, and the async support would be useful if you need to do long-polling or make http requests to other sites (e.g. making an API call to Facebook or Twitter).


Is there a mechanism for doing this in Django yet? As of right now it seems as though this is just a new handler to use the server.

Providing a way for Django to do the long polling, streaming, comet type aspect of it would be the next step, which I'm not sure Django can handle out of the box without a lot of changes. I hope someone makes it though.


Basically the async mechanism allows you to handle a lot more concurrent connections. This is handy if you do comet style applications where you need persistent connections to the clients.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: