[Twisted-web] newbie question : first template

Sylvain de Tilly sylvain.detilly at adelux.fr
Fri Apr 1 07:38:59 MST 2005


Hello,

I'm just trying Nevow and I follow the BIG example page. But I'm blocked
in the juste first test : print a string with the template. Here my
code :

------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"
xmlns:nevow="http://nevow.com/ns/nevow/0.1">
  <head>
    <title>title</title>
  </head>
  <body>
    <h3>very simple test</h3>
    Hello nevow... Could you see my <span nevow:data="test" /> ?
  </body>
</html>

------------------------------------

# -*- python -*-
# -*- coding: utf-8 -*-

from twisted.application import service, internet
from nevow import appserver, rend, loaders


class Page(rend.Page):
    addSlash=True
    
    docFactory = loaders.xmlfile('./htmlpage_first.html')

    def data_test( self, context, data ) :
        return "pattern"


application = service.Application( 'appli' )
website = appserver.NevowSite( resource=Page() )
webserver = internet.TCPServer( 8080, website )
webserver.setServiceParent( application )

-----------------------------------------------------


It must be something stupid but I could'nt find it !

Thanks in advance,
-- 

Sylvain de Tilly
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Ceci est une partie de message
	=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20050401/2c5aea05/attachment.bin


More information about the Twisted-web mailing list