如何用javascript从html文件中触发python中的变量/方法
How to trigger a variable/method in python from a html file with javascript
我想有一个html页面上的超链接运行在我的python文件中定义的变量。变量将清空数据库。这是我试图使用的代码。
Python
@app.route('/log')
def log():
cleardb = db.session.delete()
return render_template('log.html', cleardb=cleardb)