HTML buttons linked with python

I have to create a website and host it on a server. The functionality of Website is that it consist of HTML buttons and I’ve bonded those buttons to js function so when each button is pressed a unique string is generated. Actually I need to import that string to the python script running on the windows for that purpose I’ve used flask to scrap the data from my website and use it. but the problem is that in flask the HTML from where the data is extracted is stored in a folder named template in the folder where the python script is saved but in my case I have to save that template folder on the server so any one can access that webpage but in this way flask can’t access that template folder…so I’m stuck and cant figure out a way

Flask is a server-side framework: The idea is that your Flask application runs on the server and delivers websites based on your templates. The client-side (forms, Javascript) can make further requests to e.g. submit user input.