I think web.path should be web.ctx.path. -Jim
----- aksx <[email protected]> wrote:----- > code used: > def notfound(): > raise web.notfound("Page Not Found at "+ web.path) > > app.notfound = notfound() > > error: > > Traceback (most recent call last): > File "proxyTest.py", line 48, in <module> > app.notfound = notfound() > File "proxyTest.py", line 46, in notfound > raise web.notfound("Page Not Found at "+ web.path) > AttributeError: 'module' object has no attribute 'path' > > > On Oct 7, 4:06 am, Justin Davis <[email protected]> wrote: > > web.ctx is populated at request time and you're trying to use it > > outside of a request cycle -- that code runs when the server is > > started. Probably what you want: > > > > app = web.application(urls, globals()) > > > > def new_404(): > > raise web.notfound("Page Not Found at " + web.ctx.path) > > > > app.notfound = new_404 > > > > -Justin > > > > On Oct 6, 3:38 am, Akshay Shekher <[email protected]> wrote: > > > > > > > > > > > > > > > > > i use web.ctx.home in my views functions and it works fine but when i use > > > it > > > like > > > > > def notfound_cust(): > > > return "Page Not Found at "+ web.ctx.home > > > web.notfound = notfound_cust() > > > > > it shows.. > > > AttributeError: 'ThreadedDict' object has no attribute 'home' > > -- > 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. > -- 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.
