2011/1/12 andy <[email protected]>:
>
> Hi.
>
> I've been trying to get a web.py app running with the werkzeug
> debugging middleware (http://werkzeug.pocoo.org/docs/debug/)
>
> I can run my app with the werkzeug server using app.wsgifunc(), but I
> haven't been able to get the werkzeug error traceback page working.
>
> Anybody had any luck with this?

web.py catches internal errors and displays error message. To use some
other debugging functionality, the web.py internalerror handling
mechanism must be silenced.

Here is a sample code that works.

import web
import sys

urls = (
    "/", "hello",
)
app = web.application(urls, globals())

def nointernalerror():
    raise sys.exc_info()

app.internalerror = nointernalerror

class hello:
    def GET(self):
        x = y+1 # raise error
        return "hello word"

if __name__ == "__main__":
    from werkzeug.debug import DebuggedApplication
    app = DebuggedApplication(app.wsgifunc(), evalex=True)
    web.httpserver.runsimple(app)

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