views:

105

answers:

1

I am writing a tinyurl clone to learn turbogears. I am wondering how do i redirect my browser to the external website (say www.yahoo.com) from my cherrypy/turbogears app?

I googled about it, but could not find much useful info.

+2  A: 

Just raise a HTTPRedirect exception, which lives in the cherrypy namespace. Like this:

raise cherrypy.HTTPRedirect("http://www.yahoo.com")
VoY
Thanks.... works like a charm (for the urls starting with protcols specified explicitly)
Mohit Ranka