-1
试图用FLask运行一个静态html。我不断收到错误:TemplateNotFound:lucky.html用Flask制作模板
我检查了另一个类似的帖子:Flask Template Not found但是它没有帮助我的问题。我试图四处移动模板目录中包含有没有运气的lucky.html文件
文件路径:
C:\Python27\flask_practice\templates
lucky.html
lucky.py
的Python:
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def lucky():
return render_template('lucky.html')
if __name__ == '__main__':
app.run()
HTML:
<html>
<body>
<p> Hello there </p>
<p> Feeling lucky </p>
<p> 7 </p>
</body>
</html>
你能证明你的项目结构? – stamaimer