Running twisted http server - "Method Not Allowed" error

Richard Townsend richard at nospam.com
Tue May 31 12:50:46 EDT 2005


On 30 May 2005 23:50:45 -0700, qwejohn at hotmail.com wrote:

> from twisted.web import server, resource
> from twisted.internet import reactor
> 
> class Simple(resource.Resource):
>     isLeaf = True
>     def render_GET(self, request):
>         return "<html>Hello, world!</html>"
> 
> site = server.Site(Simple())
> reactor.listenTCP(8080, site)
> reactor.run()   "
> 

Try adding the line:

    allowedMethods = ('GET',)

after the line 

    isLeaf = True

-- 
Richard



More information about the Python-list mailing list