I am using Flask for the first time using PyCharm CE, my main page has
function getPage () {
$.ajax({
url: "main.py",
context: document.body
});
}
It automatically grabs the main.py file which has
@app.route('/')
def generateCaptcha():
return render_template('main.html')
I also have
window.location.href = "http://localhost:63342/Captcha/templates/loading.html
However, that never runs the python file with it. I've also noticed I can't just run main.html. But if I run loading.py, it just downloads the file. How do I redirect to another HTML page and link it to a Python page using Flask.