import os
template_dir = os.path.abspath(os.path.dirname(__file__)) + "/
templates"
render = web.template.render(template_dir)

On Aug 10, 6:19 am, Brian <bsac...@gmail.com> wrote:
> I am newer to webpy so please forgive my if my phrasing is off.
>
> I have  code and a template that work on my local machine.
> I am trying to deploy them on my server using mod_wsgi.
>
> I was following the tutorial on webpy.org but when I set everything up
> for the templates the web page only returned "not found".
>
> Below you can find the code I am using and the error logs.
>
> testcode.py
> ----------------
> import web
>
> urls = ('/', 'index')
> render = web.template.render('templates/')
> app = web.application(urls, globals())
>
> class index:
>     def GET(self):
>         name = 'Leo'
>         return render.index(name)
>
> if __name__ == "__main__":
>         app.run()
>
> app = web.application(urls, globals(), autoreload=False)
> application = app.wsgifunc()
>
> index.html
> ---------------
> $def with (name)
>
> $if name:
>     I just wanted to say <em>hello</em> to $name.
> $else:
>     <em>Hello</em>, world!
>
> log
> ------
> [Tue Aug 09 21:24:18 2011] [error] [client xxx.xxx.xxx.xxx] mod_wsgi
> (pid=6563): Target WSGI script '/etc/apache2/sites-available/www/
> testcode.py' does not contain WSGI application 'application'.

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to webpy@googlegroups.com.
To unsubscribe from this group, send email to 
webpy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to