[Twisted-Python] django with twisted 8.2.x: 2009

V S P toreason at fastmail.fm
Wed Jan 14 15:48:39 MST 2009


Hi,
wanted to ask for some help in getting django running with
twisted webserver for my experiments.

Using Python 2.6
Twisted 8.2.0
Django 1.0.2
on windows xp for now.

I searched the documentation , most of the blog entries/etc were
in '07 about this setup.  And most refer to web2 plugin for twisted
as it support for wsgi.

I looked at the web2 page on twisted matrix and it said that its
functionality will be ported back to 'web' module as they become stable.
I then browsed 'web' module subdirectory and I saw wsgi there
(and I assume this is what's needed for django).

So to shorten the story, this is what I tried:
I downloaded the example web server web.py, made sure it works
with the test file (and it does).

Then I added another 'processor' for files with extensions .wpy

root.processors = {
            '.cgi': twcgi.CGIScript,
            '.php3': twcgi.PHP3Script,
            '.php': twcgi.PHPScript,
'.wpy':  wsgi.WSGIResource,
            '.epy': script.PythonScript,
            '.rpy': script.ResourceScript,
            '.trp': trp.ResourceUnpickler,
}


then I created a simple django file
------------- views.wpy ------------
from django.http import HttpResponse

def hello(request):
    return HttpResponse("Hello world")
--------------------------------------

and tried to run it.  That, of course did not work,
for one because I did not create a 'resource' global.

But basically, I do not think I am going right way about it,
therefore decided to stop and ask.


thanks in advance
-- 
  V S P
  toreason at fastmail.fm

-- 
http://www.fastmail.fm - mmm... Fastmail...





More information about the Twisted-Python mailing list