我在主文件夹中有一个基本的 python3 脚本:
from flask import Flask,render_template
app=Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
app.run(debug=True
“模板”文件夹中的一个简单的“index.html”文件:
<!doctype html>
</head>
<body>
<a href="static/cv.html">GOT TO CV</a>
</body>
</html>
它完美运行并在“static”文件夹中打开“cv.html”:
<a href="index.html">BACK</a>
但是“cv.html”中的这个命令不起作用。错误信息说:
“获取/static/index.html HTTP/1.1” 404 -
看起来“index.html”应该在“static”文件夹中。 我怎样才能从主文件夹中取回“index.html”页面?