How to run Django on the latest Twisted web WSGI functionality
JavaScript CSS Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Django on Twisted using Twisted's (new) WSGI code

This directory contains an example of how to combine Twisted and Django using the latest WSGI functionality in twisted.web.

A more complete discussion of this code can be found here:


  1. Recommended: Use a virtualenv and install with pip, to get them type:

    easy_install virtualenv pip
  2. Create a fresh virtualenv:

    virtualenv --no-site-packages twisted_wsgi_django_env
  3. Install dependencies into your virtualenv:

    #You must have Django 1.0+ and Twisted 9.0.0+
    pip -E twisted_wsgi_django_env install twisted django
  4. Get a copy of the example:

    #Or clone a copy:
    $ git clone git://

Run example

  1. Move into your virtualenv and activate it:

    $ cd twisted_wsgi_django_env
    $ source bin/activate
  2. Move into the example and do a syncdb:

    $ cd mydjangosite
    $ python syncdb #be sure to create an admin user
  3. Move up one directory and run the example:

    $ cd .. #assume you are in 'mydjangosite'
    $ twistd -ny #open localhost:8000 in browser
  4. If you decide to build an application with this server and deploy it, you can start the server as a daemon with:

    $ twistd -y #remember to change the port in to choose an open port in your server.


All code licensed under the BSD. Contact: Alex Clemesha <> |