[Twisted-web] How to generate xhtml code with Resource.render?

Mary Gardiner mary-twisted at puzzling.org
Fri Aug 27 08:54:10 MDT 2004


On Fri, Aug 27, 2004, Krzystof Nowak wrote:
> browser dosent seem to understand that its xhtml code. I think I'm missing
> something very easy, maybe I'm not properly understand philosophy of xhtml
> or python.web. Do you know how to manage with this problem?

You might want to look at
http://twistedmatrix.com/documents/current/howto/using-twistedweb#auto17
for this. In particular:

> class Resource(resource.Resource):
> 	def render(self, request):

I believe you want to be doing this by returning a string from
render_GET, rather than by reimplementing render.

-Mary



More information about the Twisted-web mailing list