Задать вопрос

Тел: +7 965 3737 888





django on tornado

there have been many posts on running django on tornado with static media served by nginx. But for dumb people like me, the whole thing needs to be spelt out. So here is how I succeeded in serving django from a virtual host using nginx and tornado. The key thing to note is that 'root' refers to the parent directory of the root and not the full path. Also remember to put in ':' as a line end. Procedure - start the tornado server with the python script on localhost:8888, start nginx. Relax and enjoy your django at the speed of light. Nginx can be got by apt-get or yum, but you need the latest git clone of Tornado - the default tarball does not support django. btw, this install is for FC11 on my laptop - I have done it in production on lenny.

Вопрос полезен? Да0/Нет0

Ответы (3):

Ответ полезен? Да0/Нет0

I guess if your Django app is running on Apache (and Apache is serving static content), you are going to have a hell of a time trying to port it to Tornado and nginx. Especially if you are new to those technologies. I have been trying to use Tornado as my comet server, but it is terrible with jQuery integration. The self.write that Tornado does, isn't meant to return objects that jQuery understands.

Ответ полезен? Да0/Нет0

well, could not figure out how to serve media with tornado, so did it with nginx - facebook people are doing the same.

Ответ полезен? Да0/Нет0

For what it's worth, Tornado isn't a bad media server at all. In this case, it might not be a terrible idea to just have Tornado serve all of it. Of course, nginx is faster.