[問題] Flask 跑 html frameset tag
我使用 flask 來寫後端程式
test.py:
from flask import Flask, send_from_directory,url_for
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/report")
def view_report():
url_for('static', filename='report/flexmonkey/html/')
return send_from_directory('static', 'report/flexmonkey/html/index.html')
if __name__ == "__main__":
app.run(debug=True)
------------------------------------------------------------------------------
index.html:
<html xmlns:lxslt="http://xml.apache.org/xslt" xmlns:stringutils="xalan://org.apache.tools.ant.util.StringUtils">
<head>
<META http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Unit Test Results.</title>
</head>
<frameset cols="20%,80%">
<frameset rows="30%,70%">
<frame src="overview-frame.html" name="packageListFrame">
<frame src="allclasses-frame.html" name="classListFrame">
</frameset>
<frame src="overview-summary.html" name="classFrame">
<noframes>
<h2>Frame Alert</h2>
<p>
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
</p>
</noframes>
</frameset>
</html>
---------------------------------------------------------------------------------------------------------------------------------------------------
~/workspace/testReport/static/report/flexmonkey/html $ ls
allclasses-frame.html alltests-fails.html automation overview-frame.html stylesheet.css
alltests-errors.html all-tests.html index.html overview-summary.html
------------------------------------------------------------------------------
server 啟動後,他抓不到其他 frame,請問 test.py 要怎寫呢? 謝謝
127.0.0.1 - - [13/Sep/2012 11:01:25] "GET /overview-frame.html HTTP/1.1" 404 -
127.0.0.1 - - [13/Sep/2012 11:01:25] "GET /allclasses-frame.html HTTP/1.1" 404 -
127.0.0.1 - - [13/Sep/2012 11:01:25] "GET /overview-summary.html HTTP/1.1" 404 -
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.220.220.235
※ 文章網址: http://www.ptt.cc/bbs/Web_Design/M.1419657793.A.3D6.html
Web_Design 近期熱門文章
PTT數位生活區 即時熱門文章