我在Flask中遇到以下问题,
在我的模板文件夹中-
我有三个HTML文件:
server.py
from flask import Flask, url_for,redirect, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/upload')
def upload():
return render_template('upload.html')
@app.route('/database')
def database():
return render_template('database.html')
if __name__ == '__main__':
app.run(debug=True)
index.html
<a class="nav-link js-scroll-trigger" href="{{ url_for('upload')}}">Upload File</a>
<a class="nav-link js-scroll-trigger" href="{{ url_for('database')}}">Protein Database</a>
我在Firefox的Web控制台上收到的错误:
SyntaxError: '/upload' is not a valid selector bootstrap.bundle.min.js:6
Chrome出现错误:
Failed to execute 'querySelector' on 'Document': '/upload' is not a valid selector.
at Object.getSelectorFromElement
请问如何解决此错误,我们将不胜感激
非常感谢,
Ishack