Maybe it is because you set app twice in your code. Try this:
import web
import os
template_dir = os.path.abspath(os.path.dirname(__file__)) + "/
templates"
render = web.template.render(template_dir)
urls = ('/', 'index')
app = web.application(urls, globals())
class index:
def GET(self):
name = 'Leo'
return render.index(name)
if __name__ == "__main__":
app.run()
else:
application = app.wsgifunc()
On Aug 10, 3:41 pm, Brian <[email protected]> wrote:
> I still get a "not found" when looking at the index page after making
> your suggested changes.
> The log now looks like....
>
> [Wed Aug 10 07:38:35 2011] [notice] caught SIGTERM, shutting down
> [Wed Aug 10 07:38:36 2011] [notice] mod_python: Creating 8 session
> mutexes based on 150 max processes and 0 max threads.
> [Wed Aug 10 07:38:36 2011] [notice] mod_python: using mutex_directory /
> tmp
> [Wed Aug 10 07:38:36 2011] [notice] Apache/2.2.14 (Ubuntu) PHP/
> 5.3.2-1ubuntu4.9 with Suhosin-Patch mod_python/3.3.1 Python/2.6.5
> mod_wsgi/2.8 configured -- resuming normal operations
>
> To be honest, I am not sure what most of that means.
>
> On Aug 10, 1:54 am, andrei <[email protected]> wrote:
>
>
>
>
>
>
>
> > 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 <[email protected]> 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 [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.