我正在构建一个基本的Web应用程序,其中包含以下项目结构。该应用程序很好,但我得到了一些静态文件的404错误。烧瓶静态文件得到404
我没有像这样的bootstrap.css.map文件,并且无法在烧瓶中找到与此相关的足够文档。
127.0.0.1 - - [09/Feb/2014 22:37:17] "GET /static/css/bootstrap.css.map HTTP/1.1" 404 -
@app.route('/')
def index():
print 'in /'
return send_file('templates/login.html')
目录结构:
app/
├── static/
│ └── bootstrap.min.css
├── templates/
│ └── index.html
└── app.py
编辑:这是我的登陆HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>API Test Application</title>
<!-- Bootstrap core CSS -->
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS for the 'Thumbnail Gallery' Template -->
<link href="/static/css/2-col-portfolio.css" rel="stylesheet">
</head>
<body>
......simple login form..........
</body>
</html>
你可以发布login.html的内容吗? – Dikei
我可以问你为什么试图在'templates/login.html'中使用'send_file'?通常,您的模板通过使用[render_template()](http://flask.pocoo.org/docs/quickstart/#rendering-templates)返回。你确定你确实想要返回模板吗?没有渲染它? –
@MarkHildreth,我没有任何东西要呈现在login.html中。这只是一个简单的登录表单。我只想按原样返回该文件。没有什么可以呈现的。 – San