<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>首页</title>
<style>
.big{width: 1000px;margin: 0 auto;}
.up{width: 300px;height: 400px;text-align: center;background-color:lightblue;}
.down{width: 30px;height: 400px;}
.up,.down{float: left;margin: 10px auto;}
img{width: 60px;height: 60px;}
</style>
</head>
<body>
<div class="big">
{% if user_name %}
<a href="/logout/">{{user_name}}点击退出</a>
{% endif %}
<br>
{% for i in user %}
<div class="up">
{% if i.name == user_name %}
<a href="/show_user/?id={{i.id}}"><h3>店主 *{{i.name}} * 的店</h3></a>
{% else %}
<h3>店主 *{{i.name}} * 的店</h3>
{% endif %}
<table>
<tr>
<td>商品名称</td>
<td>商品价格</td>
<td>商品图片</td>
</tr>
{% for j in shop %}
{% if j.user.id == i.id %}
<tr>
<td>{{j.name}}</td>
<td>{{j.price}}</td>
<td><img src="/static/{{j.img_path}}"></td>
</tr>
{% endif %}
{% endfor %}
</table>
</div>
<div class="down">
</div>
{% endfor %}
</div>
</body>
</html>
django 够
最新推荐文章于 2019-12-06 17:13:54 发布