recentlly,i am following the screencast to learn turbogears.
but there is something wrong stopping me proceeding.
coding like this:
controllers.py:
import turbogears
from turbogears import controllers
from model import Page
from docutils.core import publish_parts
class Root(controllers.Root):
@turbogears.expose(html="wiki20.templates.page")
def index(self,pagename='FrontPage'):
page = Page.selectBy(pagename=pagename)
p = page[0]
#content =
publish_parts(p.data,writer_name="html")["html_body"]
#return dict(pagename=pagename,data=content)
return dict(pagename='frontpage',data='whaing')
and page.kid:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://purl.org/kid/ns#"
py:extends="'master.kid'">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type"
py:replace="''"/>
<title>Welcome to TurboGears</title>
</head>
<body>
<div style='float:right;width:10em'>Viewing<span
py:replace="pagename">page name goes here</span><br>
<a href="/">Front Page</a></div>
<div py:replace="XML(data)">page text goes here.</div>
</body>
</html>
runned error! output:
mismathed tags.
can someone tell me the answer?
thanx