how to browse to a external url from turbogears/cherrypy application?
-
21-08-2019 - |
Question
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.
Solution
Just raise a HTTPRedirect exception, which lives in the cherrypy namespace. Like this:
raise cherrypy.HTTPRedirect("http://www.yahoo.com")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow