web.open() not working on live server

hi everyone, in my Django web app, i have a function . which receives data from a view then uses the whatspp api url to open whatsapp which enables the user to send some messages

def messaging(subject, message, customer_mail, shipping_phone):
    subject = subject
    message = message
    seller_contact='95668398939' #Assuming this is the sellers contct info.

    web.open('https://web.whatsapp.com/send?phone=' + seller_contact + '&text=' + message)

Now this works perfectly well on my local server. but on a live server it is ignored.
i have tried adding a print statement just above the web.open method and bellow it and they print out perfectly well. what can be going wrong

You’re connecting to this server with your browser.

The server is running this view.

Where do you think the web.open function is going to run?

It’s going to run on the server.

When you were running this locally, “locally” was your PC - and so it would run that function on your PC. Now it’s running on a complete separate computer.

wow never thought of that,
so how can i make it run on the users browser

You have to do it from JavaScript - you would would need to send a script to the browser that opens that page in a different tab.