Search code examples
pythondjangobrowserhyperlinkbrowser-tab

How to open url in a new tab in Django?


I have to open the result page using render_to_response on a new tab.


Solution

  • Django is server-side, opening in a new tab is client-side. So use an <A> with a target="_blank"

    http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=target%3Dblank

    But of course spawning new windows/tabs is annoying for the user, so try not to do that after all.