【发布时间】:2017-02-14 13:01:35
【问题描述】:
我对 Flask 真的很陌生。我想在网络上创建一个移动应用程序模拟。我找到了一个我喜欢的引导模板。我在 python 中实现了一个小的 Flask 应用程序来充当服务器。
app.py
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def hello(name=None):
return render_template('index.html', name=name)
if __name__ == '__main__':
app.run()
这是 index.html 文件的主体
<body>
<div class="main-row">
<h1>Fortune Estates</h1>
<div class="main_frame">
<iframe class="frame-border scroll-pane" src="templates/main.html" frameborder="0"></iframe>
</div>
</div>
<div class="copy-right">
<p>© 2016 Fortune Estates . All Rights Reserved | Design by <a href="http://w3layouts.com" target="_blank">W3layouts</a></p>
</div>
<script src="static/js/jquery.nicescroll.min.js"></script>
<script>
$(document).ready(function() {
var nice = $("html").niceScroll(); // The document page (body)
$("#div1").html($("#div1").html()+' '+nice.version);
$("#boxscroll").niceScroll(); // First scrollable DIV
});
</script>
</body>
当我启动烧瓶应用程序时,我收到此错误127.0.0.1 - - [14/Feb/2017 14:46:45] "GET /templates/main.html HTTP/1.1" 404 -
这是我的文件层次结构
.
+-- app.py
+-- templates
| +-- index.html
| +-- main.html
| ....
+-- static
| +--js
| | +--bootstrap.cs
| | ...
| +--fonts
| | ...
| +--css
| | ...
| +--images
| |
【问题讨论】:
标签: python html twitter-bootstrap iframe flask