views:

62

answers:

1

I was about to migrate the GAE-OpenSocial project to Twisted Matrix and Nevow. I am very new to Nevow templating and couldn't find good documentation other than given in Divmod's Nevow Project page. Is there any books relating to Nevow? I am having trouble serving static files in Nevow. For app engine its easy to define static files in app.yaml. But here I can't find a suitable way. Please help.

+2  A: 

There is a large collection of examples in Nevow's source directory, Nevow/examples/. These are all runnable examples. You can start a server which will serve an index page for them like so:

exarkun@boson:~/Projects/Divmod/trunk/Nevow/examples$ twistd -ny examples.tac
... [-] Log opened.
... [-] twistd 10.1.0+r30002 (/usr/bin/python 2.6.4) starting up.
... [-] reactor class: twisted.internet.selectreactor.SelectReactor.
... [-] nevow.appserver.NevowSite starting on 8080
... [-] Starting factory <nevow.appserver.NevowSite instance at 0x94cc8ec>

Visit http://localhost:8080/ and you'll see a list of the examples and links to see their source or actually visit them and see their output.

For the particular case of static files, the answer is pretty simple, simply serve up a nevow.static.File or a twisted.web.static.File somewhere.

Jean-Paul Calderone
thanks alot buddy.. :) even though i have searched many places for examples.. I never searched inside the svn checkout.. :((
jasimmk