It’s actually really easy to make these two things work together. Since ~8.2.0 Twisted has had a WSGI container runnable from the command line. So here is how you run Django on a supported version of Twisted.web.
- easy_install Twisted
- easy_install Django
- Profit!
- django-admin.py startproject foo
- Create a myapp.py
with the following code:
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler() - export DJANGO_SETTINGS_MODULE=foo.settings
- twistd -no web --wsgi=myapp.application
So look, this is really AWESOME.
Updated (3/30/2009 4:09pm): Twisted tickets #3585, #3721 are problems on Twisted 8.2.0 but are fixed or should be fixed in Twisted trunk soon.
Updated (3/30/2009 6:34pm): Both of the above tickets are done.