@app.route('/detail')
def detail():
return render_template("detail.html")
@app.route('/first')
def first():
context={
"question":Question.query.all()
}
return render_template("first.html",**context)
{% extends 'base.html' %}
{% block title %}
首页
{% endblock %}
{% block head %}
<link href="../static/css/first.css" rel="stylesheet" type="text/css">
<script src="{{url_for("static",filename="js/change.js")}}"> </script>
{% endblock %}
{% block main %}
<body id="myBody">
{% for foo in question %}
<div id="list-container">
<ul class="note">
<li>
<div class="content">
<div class="author">
<a class="nickname" target="_blank" href="{{ url_for("detail") }}">{{ foo.author.username }}</a>
<span class="time">{{ foo.create_time }}</span>
</div>
</div>
<a class="title" target="_blank" href="{{ url_for("detail") }}">标题:{{ foo.title }}</a>
<p class="abstract">详情:{{ foo.detail }}</p>
</li>
</ul>
</div>
{% endfor %}
<div class="box">
<a href="" class="nav"><span>关于我们</span></a>
<a href="" class="nav"><span>意见反馈</span></a>
<a href="" class="nav"><span>安全保障</span></a>
</div>
{% endblock %}
{% extends "base.html" %}
{% block title%}问答详情{% endblock %}
{% block main %}
<body bgcolor="#696969">
<div class="">
<a href="#">username</a><br>
<a class="" href="#">title</a><br>
<span class="createtime">create_time</span>
<p class="location">评论</p>
<textarea style="width: 400px" id="xiang" rows="10" name="detail"></textarea><br>
<input type="submit" value="发送"style="width:65px;height:25px;font-size:15px">
</div>
</body>
{% endblock %}