So I am trying to use templator. I am getting an error. I dont know if
it is an issue with webpy looking at the wrong site-package or my code

This is the code I am using

import web
render = web.template.render('templates')

#status = '200 OK'
#output = 'goodbye'

urls = (
    '/.*', 'index',
    )

print render.index('world')

#class index:
#    def GET(self):
#        return "Hello, world!"

if __name__ == "__main__": app.run()

application = web.application(urls, globals()).wsgifunc()

///////////////

the index.html code inside the templates folder looks like this

$def with (name)
Hello $name!

One of the Issues I can see from the error log is that webpy should be
installed in opt/python2.6.5 directory

[Sun Sep 05 12:20:50 2010] [error] [client 173.63.156.204] mod_wsgi
(pid=29783): Target WSGI script '/var/www/vhosts/zevenwolf.com/
httpdocs/webpy/code.py' cannot be loaded as Python module.
[Sun Sep 05 12:20:50 2010] [error] [client 173.63.156.204] mod_wsgi
(pid=29783): Exception occurred processing WSGI script '/var/www/
vhosts/zevenwolf.com/httpdocs/webpy/code.py'.
[Sun Sep 05 12:20:50 2010] [error] [client 173.63.156.204] Traceback
(most recent call last):
[Sun Sep 05 12:20:50 2010] [error] [client 173.63.156.204]   File "/
var/www/vhosts/zevenwolf.com/httpdocs/webpy/code.py", line 40, in
<module>
[Sun Sep 05 12:20:50 2010] [error] [client 173.63.156.204]     print
render.index('world')
[Sun Sep 05 12:20:50 2010] [error] [client 173.63.156.204]   File "/
usr/local/lib/python2.6/site-packages/web.py-0.34-py2.6.egg/web/
template.py", line 1021, in __getattr__
[Sun Sep 05 12:20:50 2010] [error] [client 173.63.156.204]     t =
self._template(name)
[Sun Sep 05 12:20:50 2010] [error] [client 173.63.156.204]   File "/
usr/local/lib/python2.6/site-packages/web.py-0.34-py2.6.egg/web/
template.py", line 1015, in _template
[Sun Sep 05 12:20:50 2010] [error] [client 173.63.156.204]
self._cache[name] = self._load_template(name)
[Sun Sep 05 12:20:50 2010] [error] [client 173.63.156.204]   File "/
usr/local/lib/python2.6/site-packages/web.py-0.34-py2.6.egg/web/
template.py", line 1005, in _load_template
[Sun Sep 05 12:20:50 2010] [error] [client 173.63.156.204]     raise
AttributeError, "No template named " + name
[Sun Sep 05 12:20:50 2010] [error] [client 173.63.156.204]
AttributeError: No template named index

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