2010/8/13 Smartboy <[email protected]>:
> I got web.py working with Apache on my server, but now I am stuck with
> trying to get template files to work. I can run theme =
> web.template.render('theme/') successfully, but when i try to run
> return theme.index() the page errors out, and I get the message "No
> such file or directory" in my log files. Does anyone have any ideas as
> to why this wouldn't be working?

Looks like web.template.render doesn't check for existence of that given path.

>>> import web
>>> web.template.render("foobar")
<web.template.Render instance at 0x1005a1710>
>>> web.template.render("some/random/path")
<web.template.Render instance at 0x1005a1830>

Try passing absolute path of the template directory to web.template.render.

root = os.path.dirname(__file__)
theme = web.template.render(os.path.join(root, 'theme'))

Anand

-- 
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.

Reply via email to