File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 64, in get_source
raise TemplateNotFound(template)
TemplateNotFound: hello.html
腳本app.py的:錯誤TemplateNotFound:從燒瓶hello.html的
from flask import Flask
from flask import request
from flask import render_template
APP = Flask(_name__)
@APP.route('/')
def hello():
return render_template('hello.html')
if _name__ == '_main__':
APP.debug=True
APP.run()
我的目錄結構:
app/
├── app.py
├── app.py~
├── static
│ └── style.css
└── template
├── hello.html
└── hello.html~
只需回溯告訴我們絕對沒有。你使用什麼代碼?文件位於何處?你的目錄設置是什麼樣的? – 2015-04-05 15:06:34
腳本app.py的: 從燒瓶導入請求燒瓶進口燒瓶 從燒瓶進口render_template APP =燒瓶(_name__) @ APP.route( '/') DEF你好() : 回報render_template( 'hello.html的') 如果_name__ == '_main__': APP.debug =真 APP.run() 而hello.html的: <!DOCTYPE HTML>
<元的charset = 「utf-8」/>那麼'app.py'位於哪裏? 「hello.html」文件位於何處? – 2015-04-05 15:25:12