[Twisted-web] Re: Twisted-web Digest, Vol 19, Issue 22
bhyz00 at gmail.com
Mon Oct 24 14:24:57 MDT 2005
have since solved the problem.
I called the resource 'vwZMbr_detl' via a wrapper in the root resource
published as .tac. This wrapper was a child in the toplevel resorce.
In my class declaration for the wrapper, I did not inherit
resource.PostableResource, just 'resource.Resource', altho I had this
in the actual 'vwZMbr_detl' class.
below is the solution and parts of code, hope this helps somebody...
---start code snippet---
<-- module that was published
class zoomMbr_detl(resource.Resource): <-- the wrapper class that
called 'vwZMbr_detl' class
class zoomMbr_detl(resource.PostableResource): <-- changed to this,
class Toplevel(resource.Resource) <-- top level resource
child_vwZMbr_detl = zoomMbr_detl() <--child of top-level resource
def render(self, ctx) <--
render mthd for top level
site = server.Site(Toplevel()) <--
boilerplate for publishing
from twisted.application import service, strports
application = service.Application("ZMembr")
webserver = strports.service('tcp:8780', http.HTTPFactory(site))
On 10/25/05, twisted-web-request at twistedmatrix.com
<twisted-web-request at twistedmatrix.com> wrote:
> Send Twisted-web mailing list submissions to
> twisted-web at twistedmatrix.com
> To subscribe or unsubscribe via the World Wide Web, visit
> or, via email, send a message with subject or body 'help' to
> twisted-web-request at twistedmatrix.com
> You can reach the person managing the list at
> twisted-web-owner at twistedmatrix.com
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Twisted-web digest..."
> Today's Topics:
> 1. Form POST to a twisted web2 Resource fails... (Boh Yap)
> Message: 1
> Date: Mon, 24 Oct 2005 04:31:42 +0800
> From: Boh Yap <bhyz00 at gmail.com>
> Subject: [Twisted-web] Form POST to a twisted web2 Resource fails...
> To: twisted-web at twistedmatrix.com
> <5ca6b3580510231331y1393e6bhf0d2b817676aa319 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> I have recently (last 2 weeks) been working with twisted2 and web2.
> However when submitting a form using 'method="POST" ', I get this error:
> The requested method POST is not supported by
> But when I use 'method="GET", its OK.
> I followed the example in the Twisted2 docs.
> this is what I have in the HTML form:
> (vwZMbr_detl is the Resource thats suppose to process the Web form)
> <form method="POST" enctype="x-www-form-urlencoded"> <-- following
> example code
> ...error_msg: The requested method POST is not supported by
> <form action="vwZMbr_detl" method="POST"> <--
> this doesnt work either!
> error_msg: The requested method POST is not supported by /vwZMbr_detl.
> <form action="vwZMbr_detl" method="get"> <-- this works !
> my resource has this:
> class MyResc(resource.PostableResource):
> def render(self, ctx):
> <-- reneder method to return a string
> further notes:
> the code has been ported over from Twisted1.xx and web1, and is
> working fine as .rpy's (as beta but not yet deployed in pproduction)
> Am porting over to Twisted2 and Web2 as starting on a new project, as
> might as well use the latest and greatest... is that advisable? Can
> someone pls advise if Twisted2 + Web2 is ready for production? The
> app. will have start off with reltively low volume, but may need to
> scale up qite quickly. Any advise will be appreciated.
> I've dug around but cannot seem to find a solution, and any help will
> be appreciated....
> Boh Yap
> bhyz at mac.com
> Twisted-web mailing list
> Twisted-web at twistedmatrix.com
> End of Twisted-web Digest, Vol 19, Issue 22
More information about the Twisted-web