Hi,
I found a way to customize the page notfound using a template:
In code.py:
def notfound():
return web.notfound(render.notfound(""))
app.notfound = notfound
Then in the template folder i added a notfound.html :
$def with (text)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>404 Not Found</title>
</head>
<body>
<h1>Not Found</h1>
<p>$text </p>
<hr>
</body>
</html>
when I need to call web.notfound, simply add the desired text this
way:
raise web.notfound("Cette page ne peut être accessible.")
However, I can not display the text with European accents.
My text appears like this:
Cette page ne peut A²tre accessible
Any idea?
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.