Run Django on Tornado

Here’s the code to get Django running on Tornado. Explanation below.

I run from within my virtual environment using


I don’t use the standard python runserver provided by django.

I built this because I wanted

  • A WebSocker server which also handled authentication.
  • To reuse all the nice django apps for authentication.
  • To keep it lightweight. There are numerous ways to embed websocket frameworks inside of django, but they all seemed too heavyweight for what I was trying to do here.

I adapted this from, and I stuck this main file in the same top-level folder as my django app.

Questions or Comments? Let me know below.