【发布时间】:2021-09-10 17:41:22
【问题描述】:
我是 Web 开发的新手,我正在使用 Flask 构建我的第一个网站。当我第一次运行该网站时,Bootstrap 无法正常工作,之后我进入了检查模式,它给了我一些错误。
我尝试清空缓存,但没有任何改变。
这是 HTML 代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/bootstrap.css">
{% if title %}
<title> Project--{{Title}} </title>
{% else %}
<title> Project </title>
{%endif%}
</head>
<body>
<div class="alert alert-primary" role="alert">
Hello
</div>
<script src="js/bootstrap.js"></script>
</body>
</html>
python代码:
from flask import Flask,render_template,url_for
app=Flask(__name__,template_folder='Template')
@app.route("/")
def home():
return render_template('Home.html',title='Home')
if __name__=='__main__':
app.run(debug=True)
我该如何解决这个问题? 提前致谢!
【问题讨论】:
标签: python html flask bootstrap-4