updating (Cheetah) html in twisted webserver with Gadfly Database

Thomas none at shall.pass
Sat May 15 05:03:38 EDT 2004


Hi,

i have a webserver with (approx.) the code below, but whatever i do
the html code sent to the browser stays the same.
The strangest is, if i insert a local variable in the class which is incremented
upon each call to self.render_GET() and append it to the html code, it 
increments correctly on the browser. Could it be a probem with gadfly?


from twisted.web import resource, server

class webserv(resource.Resource):
	isLeaf = True

	def __init__(self):
		#filling self.template with html code
		#filling self._namespace with data for Cheetah

	def update_namespace(self):
		#call upon a gadfly- database and update the namespace

	def render_GET(self, request):
		return Template(self.template, searchList=[self._namespace]).__str__()


WebServer = webserv()
site = server.Site(WebServer)
reactor.listenTCP(80, site)

reactor.run()



More information about the Python-list mailing list