Open New Tab

Dear All,

Do you know if it is possible to open “www.google.fr” in a new tab from views.py ?

I know how to do it from “template” but not in “views”.
I have some calculate to do and after run the data on google map to display it in a new tab

Thanks for your help

No, it’s not possible to do that.

Keep in mind two things:

  • Views run on the server, not in the browser

  • A view receives a request and returns a response - to the process making the request.

A view has no control over the browser. Only over what response is returned for a request. It’s up to the browser to decide what to do with it.

To do what you’re describing is probably going to require some JavaScript running in the browser to manage those tabs.

Hi Ken,

Thanks for your help … antother time :wink:
Ok, I will look with Javascript