I'm writting a code in python using flask. I would like to know how to load an HTML page and also run a function in Python at the same time. here is my code:
<form action="data" method="POST">
<p>Please enter the table name <input type="text" name="table_name" placeholder="For example: My_table" id="table" required/>
<input type="text" id="email" name="email" placeholder="Your email address.." required>
<input type="submit" value="Submit" class="btn btn-primary"/>
</form>
You can see when I submit the form by clicking the submit button, the 'data' function start to run. I want the 'data' function to be activated as soon as the button is clicked and in addition to go to another page. Like for example the data.html page. The problem is that the 'data' function ran for several hours, so if I press the submit button' the data function starts to ran but I stay in the same page without redirect to another. I can't find a way to upload another HTML page in the meantime.
Hope I am clear enough, thank you very much