Using webpy, what's the proper way to reference the templates directory for web.template.render() so that it works on both the webpy development web server and on Apache?
The following code works using the development server but not when running on my Apache server.
import web
urls = (
'/', 'index',
)
class index:
def GET(self):
render = web.template.render('templates/')
return render.index(self)
I know the problem is that web.template.render('templates/')
is the problem, because the relative path is no longer valid when Apache runs from C:\Program Files\Apache Software Foundation\Apache2.2
. My templates directory is within my project folder.
What I don't want to do is use an absolute path, because I'd like to be able to move my project files around without having to tinker with the code to keep it working.