如题。
用的flask,两个网页index.html和test.html放在templates里,index.py放在根目录下。
index.html下面写了一个跳转:
<a href="../templates/test.html">Switch to baidu</a>
如果单独运行这个index.html的话可以跳转到test.html,
但是如果通过后端的index.py运行的话
index.py:
@app.route('/')
def index():
return render_template('index.html')
能成功进入Index.html,但是从index.html进入test.html的时候就会显示:
Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
编译器pycharm里显示:
127.0.0.1 - - [25/Jan/2017 23:24:00] "GET /templates/test.html HTTP/1.1" 404 -
有木有哪位大神哥哥帮忙指导一下/(ㄒoㄒ)/~~