-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